PacketFence - BTS - PacketFence
View Issue Details
0001204PacketFenceperformancepublic2011-04-04 17:502011-10-25 09:01
obilodeau 
obilodeau 
normalminorrandom
closedfixed 
1.9.0 
2.2.02.2.0 
72f89c1e24c816eb856dfe0e829f02b9aa90d6ed
0001204: Dynamic apache configuration based on system resources
PacketFence runs on a lot of different systems out there and even though we have minimum hardware requirements we know that it runs in production from simple P3 with 1Gb of RAM (below our specs) up to dual octo-cores with 24Gb of RAM.

Our aging default apache configuration has not been re-evaluated since we've switched to mod_perl (a change which implied a dramatic performance gain at the cost of keeping more stuff in memory).

Lately, while running a 700 users registration sprint in an hour or so, we saw the consequence of our bad apache defaults. Apache spawned more childs than the memory could handle and the system started to swap which killed the box.

When I started to consider a fix I've quickly realized that we will need to dynamically adjust the number of childs based on system memory. A fixed configuration would have been over-utilizing modest hardware and under-using more capable systems.

So what I'll do is we'll check for an average memory consumption per thread in the systems we have access to and build a formula that will determine how to adjust httpd.conf's MaxClients, StartServers and MinSpareServers statements.
Need to think of:
x86 vs x86_64

ps -eo rss,cmd --sort -rss | less
No tags attached.
Issue History
2011-04-04 17:50obilodeauNew Issue
2011-04-04 17:50obilodeauStatusnew => assigned
2011-04-04 17:50obilodeauAssigned To => obilodeau
2011-04-06 15:29obilodeauAdditional Information Updated
2011-04-08 13:55obilodeauNote Added: 0002019
2011-04-11 14:57obilodeaumtn revision => 72f89c1e24c816eb856dfe0e829f02b9aa90d6ed
2011-04-11 14:57obilodeauNote Added: 0002024
2011-04-11 14:57obilodeauStatusassigned => resolved
2011-04-11 14:57obilodeauFixed in Version => trunk
2011-04-11 14:57obilodeauResolutionopen => fixed
2011-05-04 11:33obilodeauFixed in Versiontrunk => 2.2.0
2011-05-04 11:40obilodeauStatusresolved => closed
2011-10-25 09:01obilodeauTarget Version+1 => 2.2.0

Notes
(0002019)
obilodeau   
2011-04-08 13:55   
After some discussions / research:

MaxClients = (total ram - (total ram x 0.25 + 300)) / 50
with a hard limit of 256.

StartServers = MaxClients / 2
MinSpareServers = MaxClients / 4
(0002024)
obilodeau   
2011-04-11 14:57   
implemented as discussed earlier