linux - What is the reason to kill old server threads/processes and launch new ones after serving certain number of requests -


for example apache httpd provides directive maxconnectionsperchild controls how server recycles processes killing old ones , launching new ones.

what reason killing old threads @ after serving number of connections.

isn't hot cache thing applicable here?

from the docs:

setting maxconnectionsperchild non-zero value limits amount of memory process can consume (accidental) memory leakage.

so if you're leaking 1 mb per request (malloc() not free()), gradually use more , more memory until run out , apache gets killed. if set maxconnectionsperchild 100, child gradually use 100 mb of memory, killed , go down 0.

the "hot cache" thing applicable here, setting maxconnectionsperchild slow down apache. that's why default infinite. maxconnectionsperchild meant inelegant duct-tape on memory leaks. time-pressured programmer might prefer spending 1 minute setting maxconnectionsperchild, rather 1 week hunting malloc() calls.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -