perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Vanasco <modperl-l...@2xlp.com>
Subject Re: forking/subprocess/etc
Date Tue, 05 Sep 2006 21:50:01 GMT

On Sep 5, 2006, at 4:14 PM, Perrin Harkins wrote:

> The memory would be shared by CoW and I haven't seen that zombie
> problem.

yeah, but apache instances seem to take up 5-10mb of memory per- 
instance.  i think 3 is for apache itself, and the rest is various  
stuff.  10 requests to this page within 1 minute of each other could  
wipe out 100mb of ram.


> I usually handle this kind of thing with a job queue system
> though, i.e. the same way you did with your Python thing.

i ended up just converting / writing to python. but just as good-  
flipping between the two languages helps me refactor and optimize  
code  -- and clarity -- as i have to thing about solutions slightly  
differently.

> Incidentally, I don't see why your Python job queue can't just  
> execute a Perl script to do this job.

didn't really think of that :)

although if i did that, i'd have to do some crazy PID watching thing,  
to make sure I don't have too many jobs running at once...

i ended up just hacking together a quick daemon using Twisted Python-  
took about 4 hours to get running (including perl conversion, which  
netted me a bunch of regex optimizations while i was at it!)   
( granted I had another one running so it was easy to transition this )

	startup-
		clear locks ,
		create job queue
	every 5 seconds-
		poll db for requests, create locks on requests, transfer to the job  
queue
		run the job queue

there's some stuff in there to manage processes , but its working as  
I expected.

Mime
View raw message