2012-04-25 20:52
浏览 27

Apache Benchmarks非常糟糕,有什么建议吗?

Using Apache Bench, the home page of my site can only handle 0.42 requests per second. A simple phpinfo() page can handle 31.99 requests per second, which seems really slow for such a simple script. Obviously my home page handling 0.42 requests is not acceptable.

I'm running Apache 2.2 on Windows Server 2008. 4 GB RAM, 2.4 GHz Intel Xeon CPU.

The site is built on the PHP CMS Expression Engine with a MySQL database. Expression Engine has really aggressive page caching, so the home page is for all intents and purposes static (there is some processing going on, but it just ends up storing a static file on the hard drive). I have SQL caching turned on as well (200 mb allocated). When the page isn't cached, there is 84 queries on the home page, which doesn't seem too crazy.

Anyone have any obvious ideas as to how I can make this thing run better? Some kind of php.ini, my.ini or httpd.conf setting I should check out?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongshun1884
    dongshun1884 2012-04-25 20:59

    You can use a reverse proxy, like Varnish, because the fastest application is the application, that is not executed. Especially the ESI-Support is quite cool to speed up highly dynamic pages.

    点赞 评论
  • dongzhan2029
    dongzhan2029 2012-04-25 22:20

    That's pretty poor. On the machine I'm sitting at I get 42 pages/sec using ab -c 30 -n 1000 http://localhost/phpinfo.php and this is a much more basic machine which is doing lots of other stuff too. It is running Linux though ;)

    Are you sure that the bottleneck is the PHP? If so, then try using an opcode cache. Apart from that it's the usual tuning process.

    there is 84 queries on the home page, which doesn't seem too crazy.

    OMG! Maybe not on your planet. If you're expecting any volume of traffic then you should be looking at ESI frames.

    点赞 评论