Apache mpm event-increasing StartServers has no effect on memory

apache-2.4centoslinuxmpm-event

I'm using apache mpm event on centos server with the following configs:

<IfModule event.c>
StartServers 8
ServerLimit 64
ThreadsPerChild 256
MaxRequestWorkers 16384
MaxConnectionsPerChild 10000
MinSpareThreads 125
MaxSpareThreads 250
ThreadLimit 256
KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 500
</IfModule>

I then increased the value of StartServers from 8 to 32 and rebuilt and restarted apache, but I can't see any difference in free memory of system. I expected to see more ram is being used by apache when I increase the value of startServers. why no change is happening in ram usage? does it mean I'm doing something wrong?

Best Answer

Additional "servers" get forked, which is (initially) a very lightweight operation, as the memory doesn't actually get copied for each process. The original and forked process will continue to share the same memory pages until they are being written to with a copy-on-write mechanism. Only once each forked process, each apache "server" starts experiencing load you will see a relevant increase in memory consumption.

Related Topic