On Wed, Apr 10, 2002 at 02:49:29PM +0100, Ian Stuart wrote: > On Wed, 2002-04-10 at 04:48, Rocco Caputo wrote: > > > > What do you want the child process to do?
> In this instance, I wish to have a seperate process to each image being > manipulated. > > To recap: I have a system that loads an image, and then allows the > client to zoom and pan around the image. > > The current system is threaded - so as the number of simultanious > clients increases, the available time for each client decreases. > > As my production server is quite meaty, I think that forking off > resident processes to act for each client (using the central POE server > as a redirecting broker) would scale better. When I talk about scaling, > I'm talking about 100+ clients simultaniously accessing the system, and > each recieving response times of under 5 seconds :) > > So, I want the server to accept an http request, and pass the request to > the appropriate child (based on the session ID - spawning a new child if > required). The child contains the image object. > > I think it will be fairly trivial to have the server poke each child (to > persuade the abandoned ones to die.. [as it were] ) POE::Component::DBIAgent does something like this. It manages a pool of child processes. Each one exists to run database queries in the background, returning results to the parent asynchronously. In that case, the parent acts as the web server and each child does the hard work. If I understand the model correctly, it assumes that child processes may be reused. The DBIAgent component is avaliable on the CPAN. Maybe you can base your server on what it does? -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net
