Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
PHP Programming Software Apache

Optimize PHP and Accelerate Apache 191

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."
This discussion has been archived. No new comments can be posted.

Optimize PHP and Accelerate Apache

Comments Filter:
  • by Anonymous Coward on Sunday May 27, 2007 @10:54AM (#19291973)
    Lighttpd?
    A buggy server and FastCGI, really great combination.
    No thanks!
  • by pooh666 ( 624584 ) on Sunday May 27, 2007 @11:48AM (#19292335)
    Apache is what you *make* of it. If it is heavy look to your sysadmin and cut out the stuff you don't use. The idea that Apache is a bottleneck compared to ANY scripting application is totally misguided nonsense. I can't believe such an ignorant comment got any mod points, even on Slashdot. I can get at least 100Mbs out of a single server pumping out static content with nothing special other than removing unused modules in the compile to save on memory. So guess what, you are WRONG.. I at one point tried using things like thttpd for banner servers, I found with a little work, I could get Apache to run FASTER than those tiny httpd servers and I didn't loose out by having to work with a feature poor server.
  • by gbjbaanb ( 229885 ) on Sunday May 27, 2007 @12:05PM (#19292461)
    They are for static content.

    Now lighttpd serves 6 out of the top 250 sites. Do you think the other 246 run IIS or something?

    Lighttpd is good, but is best used in specialised instances, for specific (mainly static content) tasks. Its pointless using it for PHP as the cost of forking out a process to run the script will outweigh any saving from running a lighter-weight http server.

  • Re:Dunmp then both (Score:2, Insightful)

    by butlerdi ( 705651 ) on Sunday May 27, 2007 @12:36PM (#19292687)
    Well, it now has all of the original functionality it had and that is down to the lack of redundant code and frameworks. Declarative based systems are just different. PHP is an awful lot of code. The code seems to me difficult to maintain and modify, but this is just my experience. I stopped using the J2EE frameworks for the same reason. After 30 years of hacking this stuff I have seen an awful lot of 3GL, 4GL .... and other frameworks and they all have to me seemed a bit bulky. Like when I try to find the actual business logic in most of them. Web based apps have come a long way, I started with WebObjects on the Next machines, and have tried many of the methodologies currently being used Ruby, Groovy, PHP, JSP et al. Declarative and RESTfull systems have just worked for me and I have always found that most of the code in the others was for the framework not my app. But as I said before, this has just been my humble experience.
  • by malsdavis ( 542216 ) on Sunday May 27, 2007 @01:18PM (#19292999)
    "PHP is slower than Perl or Python for most stuff."

    I'd say that in practice (i.e. when performing the vast majority of dynamic web functionality: e.g. database lookups) the opposite is true. Perl & Python are quicker at some tasks, but every-time I've rewritten a website between PHP and Perl (I don't program in Python because it's named after my most hated animal), PHP has come out slightly on top.
  • by Fweeky ( 41046 ) on Sunday May 27, 2007 @01:41PM (#19293135) Homepage
    Quite; you can easily use FastCGI with Apache too (though lighttpd's built-in load balancing sounds nice; hopefully mod_proxy{,_balancer} will one day grow useful FastCGI support). Do that and watch as Apache sits using about 1000x less CPU than your backend PHP's.

    lighttpd and friends are generally better if you're serving static content, but it's doubtful you'll notice unless you're talking in terms of many thousands of requests per second to a single server. That's not to say there aren't other reasons you might want to use lighttpd, but performance isn't really one of the interesting ones.
  • by SQL Error ( 16383 ) on Sunday May 27, 2007 @02:38PM (#19293555)
    The problem is not that Apache is slow, it's that it uses huge amounts of memory. If your database is running slow for some reason - say, during backups - requests will start to queue up, Apache will start more and more threads to handle those requests, and things will spiral rapidly out of control.

    Lightppd doesn't have that problem.
  • by Anonymous Coward on Sunday May 27, 2007 @02:55PM (#19293641)
    > Lightppd doesn't have that problem.

    No, it leaks memory instead.

    Nginx doesn't have either problem.
  • by kv9 ( 697238 ) on Sunday May 27, 2007 @08:52PM (#19296129) Homepage
    Yep your right. Slashdot runs off Perl. I find it rather ironic how few people here would say good things about Perl.

    or that "shitty non-database" MySQL that manages to store all the bazillion comments/stories and is constantly hit.

  • by Rudd-O ( 20139 ) on Monday May 28, 2007 @03:27AM (#19298073) Homepage
    Yes, it queues request, and you can configure the queue depth in the Apache config file. See the apache docs.

Arithmetic is being able to count up to twenty without taking off your shoes. -- Mickey Mouse

Working...