Slashdot Mirror


Optimize PHP and Accelerate Apache

An anonymous reader writes "As the load on an application increases, the bottlenecks in the underlying infrastructure become more apparent in the form of slow response to user requests. This article discusses many of the server configuration items that can make or break an application's performance and focuses on steps you can take to optimize Apache and PHP."

8 of 191 comments (clear)

  1. Of course! by BabaYama · · Score: 5, Funny

    You should compile it yourself wicked fast compiler optimizations on top of your wicked fast install of Gentoo (which you also compiled yourself)

    --
    Sucks
  2. But I Can't Pronounce "LLMP"! (n/t) by Mateo_LeFou · · Score: 3, Funny

    no text

    --
    My turnips listen for the soft cry of your love
  3. http is the problem by larry+bagina · · Score: 5, Funny

    Last year, we dumped apache (and http altogether) and went with a gopherd/fastcgi approach for serving up our php pages. For people still stuck on port 80, we have a squid proxy which converts the request to gopher. Since then, traffic has increased 34%, while average load has dropped by 20%.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  4. Re:But I Can't Pronounce "LLMP"! (n/t) by larry+bagina · · Score: 2, Funny

    try LOL - Linux/OCaml/Lighttpd

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  5. Re:Dunmp then both by gbjbaanb · · Score: 2, Funny

    If I took an app, "lost" 95% of the code, then I guarantee it'd work faster. Of course, by "work" I mean, "do nothing" but lets not let a little semantics get in that way of some technical self-aggrandisement. :)

  6. Re:want performance from php? by Anonymous Coward · · Score: 5, Funny

    Dear Opera user: Fuck you.

  7. Re:But I Can't Pronounce "LLMP"! (n/t) by zitch · · Score: 3, Funny

    Just keep IIS in its native environment and we'll get WIMP... :)

  8. The real way to improve server performance... by dgym · · Score: 5, Funny
    ...is to decrease load on the server. Most of the work can be done on the client anyway, so that is where it belongs.

    Here are a few tips:
    • Databases can get pretty slow with complicated queries, so upload your database to the client when they load the page and then your database queries are distributed.
    • PHP isn't very fast, and neither are Perl or Python, so you don't want to be running them on the server either. Write an interpreter for the language of your choice in Javascript and move your business logic to the client. This will also interface better with the client side database copy.
    • SSL is a performance killer, don't use it. If you need to send something securely just prefix it with a predetermined number of random letters and numbers, no one will think to look beyond them.
    • Writing to databases can be pretty bad too. Try discarding all your changes, your users might not notice the difference, but they will appreciate the performance gain.
    • Even with all the above you might still be getting too many requests. Try designing your site to exploit bugs in the major browsers and reconfigure your users machine to store and load everything itself.
    • Get better hardware.
    • Make your site less interesting, or less reliable. Changing your DNS entry to point to an unrelated site for one week a month can really help reduce load.
    • If you have had success with the other steps then you don't need a dynamic server anymore, code a simple static server in assembly, preferably for the architecture you intend to be running on, and be done with it.

    Best of luck!