I have a system that currently has 5-6 Perl daemons running on it 24/7. This system has 2 GB, multi-core, and 4 GB of RAM.
I am working on a different version of this system that will be running on a 500 Mhz 500 MB system (a Soekris Net5501, if knowing the system makes a difference). Both systems are Debian Linux based.
From my limited understanding, if I use fork(), both the parent and child process are running within the same instance of Perl in memory. I remember experimenting with this previously and having to kill zombie processes, but I don't see them remaining anymore after a child thread is killed on my current systems. (Which are running later versions of both Linux and Perl than what I started on.) This is without using $SIG{CHILD} = 'IGNORE'.
I'd like to be able to use one instance of Perl to run all the daemons on the newer system. The ones on the new system will be smaller and have less to do than the ones on the big computer. But I have three main questions about this.
1) On the other system I would create a batch file that was an endless loop. In the loop it'd run the daemon, that way if the daemon was killed, it'd loop back through and run it again. I've seen a number of programs do this. But on Perl, unless I want to keep dealing with zombies, is there a way to tell when a child process has quit?
2) Regarding zombies: Was there some improved coding somewhere or a change in how things are handled in Linux? I don't see zombies showing up when I run tests now.
3) If I use one instance of Perl and fork off a number of child processes instead of running multiple instances of Perl, will that change the priority for the forked processes, or will they likely get the same kind of treatment or CPU time as they would have if I ran them as separate processes?
Thanks for any information on this. I've been Googling, but have yet to find information on this that's clear to me or can tell me why I don't see zombies now when I test fork() and kill off the child processes.
In reply to Forking vs. A New Process by HalNineThousand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |