Ticket #13 (assigned enhancement)

Opened 1 year ago

Last modified 1 year ago

PreforkServer recreating processes under high load

Reported by: trac Assigned to: asaddi (accepted)
Priority: minor Milestone:
Component: flup.server Version: 0.5
Keywords: Cc:

Description

I'm trying to take advantage of a 4-way machine using the PreforkServer?. While using up to 4 child processes (1 for each cpu), I'd like the server to return to 1 child after load dies down. Specifically I'm using the scgi_fork server. With these settings:

maxSpare=1 maxChildren=4

The number of children jump up to 4 under high load, but the PIDs keep incrementing so I think children are being killed and created while under load. I think that the children should not die until the load drops off.

I get much better performance (100% of 4 cpus) with this setting:

maxSpare=4 maxChildren=4

But then I've got RAM tied up for no reason.

A think that a solution to this is to specify a time to live for excess children. When an excess child has not been used for x seconds, it can be killed. Otherwise it should continue to serve.

Randall - randall at tnr dot cc

Change History

02/22/07 14:17:35 changed by asaddi

  • status changed from new to assigned.

I'd hate to have to keep track of when each child was last busy - but perhaps the desired behavior can be approximated by killing 1 excess child every X seconds (where X is configurable and probably defaults to 0?).

Anyway, it seems like a relatively straightforward feature to add, regardless of how the TTL is implemented.

02/23/07 13:08:42 changed by asaddi

  • milestone changed from flup.server-1.0 to flup-0.6.

09/11/07 15:25:47 changed by asaddi

  • milestone deleted.

Milestone flup-0.6 deleted