Apache PHP Performance Limit

Hi,

I’d like to find out if my system can take a certain load, number of PHP requests per unit of time. How would one go about this?

I’m about to make a change on Digital Camera Buying Guide, Photography Articles and Reviews | NeoCamera.com that would make all pages pass through PHP with personalized information which will prevent me from setting the cache-validity any significant amount of time (currently it is 1 hour). To handle the current load it needs to process 500 PHP requests per minute but I would like to make sure my system can handle twice the load. It is a Phenom II X4 with 8GB RAM running OpenSUSE 11.2.

Thanks in advance,

  • Itai

Set up a test bench with a automated client and start pounding the web server with requests and measure the effect I suppose?

You could use a test tool like Apache JMeter

JMeter - Apache JMeter

I’ll take a lot at JMeter is seems promising.

Pounding the server could work if I had something that could sent enough requests. I don’t think it will show a linear response though, so I can’t send 10% of the load and multiply the results by 10. Right?

Thanks for the replies!

  • Itai

Not too right. Personally I would prefer following approach:

Assuming that you have a kind of test scenario, i.e. some users performing some actions on the site, there are 2 ways of creating JMeter Test script:

  1. Use JMeter HTTP Proxy Server to record navigation via browser.
  2. Use JMeter access log sampler. Feed your Apache log to JMeter access log sampler and it’ll generate more or less realistic script which reflects user activity in regards to your application.

If following option 1 mention Constant Timers which are recorded. Basically they are required to simulate delay. Realistic value is around 20-40 seconds between requests.

JMeter also provides some components which can make it pretend to behave like a real browser:

[LEFT]1. Add Cache Manager to emulate browser cache.
2. Add Cookie Manager to support sessions, logins, etc. Don’t forget to set ʺCookieManager.save.cookies=trueʺ property in jmeter.properties file under /bin folder of your JMeter installation.
3. Set ʺRetrieve embedded resourcesʺ to ʺtrueʺ to enabled css, images, js, etc. fetching. Don’t forget to filter external URLs via ʺEmbedded URLs must matchʺ input to keep results clean (we don’t need to load test external banners, google analytics, etc.
4. Add HTTP Header Manager with corresponding User-Agent string (or number of user-agents if you like) to get pages rendered accordingly.

Assuming all above I believe that given proper JMeter configuration you’ll be able to report that your system supports up to N users producing zero errors without having to multiply some “abstract” load by factor of 10.

Hope this helps,

Dmitri.
[/LEFT]