pavinjoseph
Posts: 10
Joined: Mon Mar 02, 2015 8:43 am

How to improve apache performance and reduce timeouts

Mon Mar 30, 2015 7:24 pm

I was testing my Raspberry Pi 2 Model B with an Apache web server. The Pi itself is overclocked using the Moderate Preset. It works reliably 24x7. I recently conducted Load Testing on the apache server and it held up pretty good, better than I expected. 10000 clients in 1 minute and only 169 timeouts. Test Results

How can I improve upon this figure and what would be the steps required to further reduce response time and/or timeouts.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: How to improve apache performance and reduce timeouts

Tue Mar 31, 2015 4:31 pm

If just serving static pages, make sure you have enough apache processes running to handle peak traffic - check the apache error log for "max client" errors.

If serving managed content, eg Wordpress, there will be many tuning variables within the content manager to try.

Check the overall data rate did not max out your network upload/download speed. Check the Pi is not doing anything else during the test period (eg. cron). Check the data rate did not max out your storage read speed. The list is pretty endless, according to the permutations of your setup.
Unix engineer since 1989

Ulric
Posts: 18
Joined: Sun Feb 17, 2013 5:41 pm

Re: How to improve apache performance and reduce timeouts

Wed Apr 01, 2015 6:51 am

pavinjoseph wrote:I was testing my Raspberry Pi 2 Model B with an Apache web server. The Pi itself is overclocked using the Moderate Preset. It works reliably 24x7. I recently conducted Load Testing on the apache server and it held up pretty good, better than I expected. 10000 clients in 1 minute and only 169 timeouts. Test Results

How can I improve upon this figure and what would be the steps required to further reduce response time and/or timeouts.
I don't know how the loader.io test works, but it looks from the graph like they ramped up the number of clients very aggressively, causing Apache to spawn a very large number of processes, which made the load climb rapidly on the Pi. As a result the response times went up along with the timeout rate. Look at the "Times" tab: the clients/sec peaked at ~00:06 and the response time a few seconds later at ~00:11. After that the test backed off to ~200 clients/sec and the response time was steady for the remainder of the test. Look at the "Details" tab: timeouts also peaked at ~00:11, but after the initial load there wasn't a single timeout. Without knowing anything more about the test, I would say it looks pretty good.

You should try repeating the test. Apache should be better equipped to deal with the initial load after it has been "warmed up".

Return to “Networking and servers”