Re: Apache2::SubProcess subprocess not subprocessing properly

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Tuesday 09 February 2010 14:21:57 Tosh Cooey wrote:
> use POSIX 'setsid';
if( fork ) { POSIX::_exit 0; CORE::exit 0 }
> chdir '/'                or die "Can't chdir to /: $!";
> 
simplest is to fork() another time to break the parent-child relationship.

Keep in mind that you make your service vulnerable if you simply fork off long 
running processes.

What prevents a user from testing it:

  ab -n 100000 -c 100 http://...

This will quite fast create a *lot* of processes.

I tend to use some kind of queue for such processing. But, of course, it 
depends.

Torsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.