ObiHill
ObiHill

Reputation: 11876

PHP APC and Memcache Benchmarking

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 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.

Upvotes: 2

Views: 999

Answers (1)

ircmaxell
ircmaxell

Reputation: 165201

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...

Upvotes: 4

Related Questions