开发者

Benchmark PHP in Apache and HipHop for PHP?

I'm doing some research about HipHop for PHP. (I love PHP).

We heard that Facebook said that using HipHop for PHP on their web server make their code fa开发者_如何转开发ster, use less CPU and memory. That looks like a great technology if it's true.

Right now I'm trying to use the HipHop for PHP to see whether it's really optimize PHP code or not. The problem is, I haven't got the idea how to benchmark PHP code performance in the CPU usage, memory usage, and execution time. (In this case, I want to compare it with APACHE server). Any idea of references?


To benchmark a webpage / website, you can use tools such as :

  • ab - Apache Bench : great for calling one page again and again
  • Siege : allows to bench more than one URL
  • JMeter : allows for more complex scenarios.


In any case, with those tools, you'll be able to :

  • Send a lot of requests to a webserver
  • Specify the number of concurrent users that should be simulated.


Please, keep in mind that code execution is not a usual PHP bottleneck. Thus, these tests will make no sense if being run in testing environment, not real one.
There are many other tings that affects site performance, and code execution being last of them, and should be optimized after everything else got tuned perfectly. Or, even better, only when profiling will tell you that code execution become a bottleneck.
So, in most environments you will get no results or wrong results.

In fact, I doubt you will notice any difference (in real environment, not running hello world) from usual opcode cache unless you're running a small data-center of your own.
I am afraid that only a few sites in the world can gain anything from that hip hop. It's all that amazing and romantic and stuff, but if you need real performance optimization, it would be somewhere else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜