开发者

PHP APC and Memcache Benchmarking

开发者 https://www.devze.com 2023-01-08 19:13 出处:网络
Is there any simple test I can try to benchmark APC and Memcache, just to get a sense of the performance benefits of using them?

Is there any simple test I can try to benchmark APC and Memcache, just to get a sense of the performance benefits of using them?

I tried some simple stuff using microtime() and开发者_StackOverflow looping requests to my database and storing the results, first in cache and then without, but I didn't notice any significant performance boost.

Thanks.


The real benefit is not easy to test. The problem is the are they help with is concurrency, not just page execution time... And that's a non-trivial thing to test.

One option, would be to use ab (Apache Bench) to issue repeated HTTP requests to the same page, and measure the difference in request rate and load...

ab -c 20 -n 1000 http://www.example.com/index.php

The -c 20 says to use 20 concurrent clients (simulating 20 simultaneous users). The -n 1000 says to make a total of 1000 requests. Then, look at both the Time Per Request and the Requests Per Second fields. Play around with different APC/Memcache settings (even disabling them) to watch how those figures change...

0

精彩评论

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