Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache tuning!
PostPosted: Sun Dec 12, 2010 2:47 pm 
Offline
Junior Member

Joined: Sun Nov 07, 2010 10:36 pm
Posts: 33
Website: http://www.rent-matcher.com
So, I've been testing one of my new servers(Linode 2048) with the following apache configs:
ServerRoot "/etc/apache2"

LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}

Timeout 3

KeepAlive Off

MaxKeepAliveRequests 150

KeepAliveTimeout 3

#PREFORK
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxClients 20
ServerLimit 20
MaxRequestsPerChild 100
</IfModule>

# worker MPM
<IfModule mpm_worker_module>
StartServers 5
MinSpareThreads 2
MaxSpareThreads 25
ThreatLimit 75
ThreadsPerChild 75
MaxClients 150
MaxRequestsPerChild 500
</IfModule>

# event MPM
<IfModule mpm_event_module>
StartServers 2
MaxClients 100
MinSpareThreads 15
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 500
</IfModule>

I'm currently using prefork.

I've been running AB against the host and getting the following results:
ab -n 10 -t 25 "http://ha1/"

and getting pitiful results:

Finished 9 requests


Server Software: Apache/2.2.14
Server Hostname: 173.255.238.110
Server Port: 80

Document Path: /
Document Length: 67619 bytes

Concurrency Level: 1
Time taken for tests: 26.514 seconds
Complete requests: 9
Failed requests: 8
(Connect: 0, Receive: 0, Length: 8, Exceptions: 0)
Write errors: 0
Total transferred: 611113 bytes
HTML transferred: 608287 bytes
Requests per second: 0.34 [#/sec] (mean)
Time per request: 2945.975 [ms] (mean)
Time per request: 2945.975 [ms] (mean, across all concurrent requests)
Transfer rate: 22.51 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 26 27 1.8 26 32
Processing: 1931 2919 2378.1 2164 9255
Waiting: 1027 1320 235.8 1277 1886
Total: 1957 2946 2377.9 2191 9281

Percentage of the requests served within a certain time (ms)
50% 2185
66% 2197
75% 2206
80% 2331
90% 9281
95% 9281
98% 9281
99% 9281
100% 9281 (longest request)


To be fair, it is a very heavy install Wordpress but I'm thinking that I should be able to handle more than 0.34 requests per second. Perhaps its my AB command? I don't think so though. Any help will be greatly appreciated!


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 4:21 pm 
Offline
Junior Member

Joined: Thu Jan 07, 2010 8:12 pm
Posts: 21
What sort of caching do you have running with WordPress?

jefe78 wrote:
MaxRequestsPerChild 100

It's probably not the source of your woes, but this seems excessively low.


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 4:44 pm 
Offline
Junior Member

Joined: Sun Nov 07, 2010 10:36 pm
Posts: 33
Website: http://www.rent-matcher.com
Emufarmers wrote:
What sort of caching do you have running with WordPress?

jefe78 wrote:
MaxRequestsPerChild 100

It's probably not the source of your woes, but this seems excessively low.


Hey Emufarmers, I'm not entirely sure as our developer is handling Wordpress but I know he's caching heavily.

What is a more appropriate MaxRequestsPerChild value?


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 5:45 pm 
Offline
Junior Member

Joined: Thu Jan 07, 2010 8:12 pm
Posts: 21
jefe78 wrote:
Hey Emufarmers, I'm not entirely sure as our developer is handling Wordpress but I know he's caching heavily.

You should probably ask him for some specifics. The benchmark results you're getting are the sort I'd expect from Web software that's running without caching.

jefe78 wrote:
What is a more appropriate MaxRequestsPerChild value?

Something like 500 or 1000 or higher would probably be sensible, unless you're noticing significant memory leaks.


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 10:06 pm 
Offline
Junior Member

Joined: Sun Nov 07, 2010 10:36 pm
Posts: 33
Website: http://www.rent-matcher.com
Emufarmers wrote:
jefe78 wrote:
Hey Emufarmers, I'm not entirely sure as our developer is handling Wordpress but I know he's caching heavily.

You should probably ask him for some specifics. The benchmark results you're getting are the sort I'd expect from Web software that's running without caching.

jefe78 wrote:
What is a more appropriate MaxRequestsPerChild value?

Something like 500 or 1000 or higher would probably be sensible, unless you're noticing significant memory leaks.


I checked and we're running db-cache-reloaded & w3-total-cache. I've been hitting it off and on and we're still only getting 0.43 requests per second. Something seems to be bottlenecked to me.


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 11:33 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
jefe78 wrote:
Concurrency Level: 1


There's your problem. You tested with no concurrency whatsoever, which will obviously produce very low results while most of your apache processes sit idle.


Top
   
 Post subject: Re: Apache tuning!
PostPosted: Sun Dec 12, 2010 11:39 pm 
Offline
Junior Member

Joined: Sun Nov 07, 2010 10:36 pm
Posts: 33
Website: http://www.rent-matcher.com
Guspaz wrote:
jefe78 wrote:
Concurrency Level: 1


There's your problem. You tested with no concurrency whatsoever, which will obviously produce very low results while most of your apache processes sit idle.


Gotcha. I'll fix that and try again!


Top
   
 Post subject:
PostPosted: Sun Dec 12, 2010 11:42 pm 
Offline
Junior Member

Joined: Sun Nov 07, 2010 10:36 pm
Posts: 33
Website: http://www.rent-matcher.com
New results:


ab -c 20 -t 10 "http://173.255.238.110/"
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 173.255.238.110 (be patient)
Finished 1 requests


Server Software: Apache/2.2.14
Server Hostname: 173.255.238.110
Server Port: 80

Document Path: /
Document Length: 67619 bytes

Concurrency Level: 20
Time taken for tests: 25.956 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Total transferred: 1358078 bytes
HTML transferred: 1351798 bytes
Requests per second: 0.04 [#/sec] (mean)
Time per request: 519119.300 [ms] (mean)
Time per request: 25955.965 [ms] (mean, across all concurrent requests)
Transfer rate: 51.10 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 26 26 0.0 26 26
Processing: 25930 25930 0.0 25930 25930
Waiting: 6658 6658 0.0 6658 6658
Total: 25956 25956 0.0 25956 25956


Would something more appropriate be:
ab -c 20 -t 10 -n 1000 "HOST"?


Top
   
 Post subject:
PostPosted: Mon Dec 13, 2010 11:15 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Sure, but I'd agree at this point that your benchmark results do show a serious bottleneck somewhere.

Your Apache configuration looks good to me, although I'm not an expert in that (I don't use Apache). You said you've already got WP caches going, so that seems to be covered... I think at this point you need to try to deduce where the bottleneck is. For example, try running 'top' while doing a lengthy ab test and seeing if anything is maxing out the CPU, or if iowait is really high, etc. If Apache is eating up all the CPU time, try fastcgi, which will split out PHP into separate processes, which will let you identify if PHP is the culprit. If it is, a PHP cache can help slightly. If the database is at fault, then tweaking the database server might be warranted.


Top
   
 Post subject:
PostPosted: Mon Dec 13, 2010 1:10 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
If w3-total-cache doesn't handle php caching, then apc (php cache) would probably help a lot.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group