Click here to get back home

Creating a 'load simulator' by calling Perl Programs - or Forking?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Creating a 'load simulator' by calling Perl Programs - or Forking? pgodfrin 04-03-2008
Get Chitika Premium
Posted by J. Gleixner on April 4, 2008, 12:19 pm
Please log in for more thread options
sheinrich@my-deja.com wrote:
[...]
> a module that I've written couple of months ago was for that very
> purpose.
> Basically your script will have to instantiate an PreforkAgent, tell
> it how many children to beget (degree of parallelization) and provide
> it with a couple of callbacks as means of communication.

Hu.. sounds pretty much like Parallel::ForkManager.

Posted by sheinrich on April 4, 2008, 2:30 pm
Please log in for more thread options
wrote:
> sheinr...@my-deja.com wrote:
>
> [...]
>
> Hu.. sounds pretty much like Parallel::ForkManager.

That might well be.
PreforkAgent came into being after I'd 'inherited' a customized
loadtesting script to which more and more functionality was to add. So
I was looking for a means of abstraction. Only after that was
finished, did I peak into the Parallel namespace.
Yet I didn't bother to explore how much of my work, which I had
enjoyed, has been gratuitous.
:-)

steffen

Posted by sheinrich on April 24, 2008, 4:50 am
Please log in for more thread options
wrote:
> sheinr...@my-deja.com wrote:
>
> [...]
>
> > a module that I've written couple of months ago was for that very
> > purpose.
> > Basically your script will have to instantiate anPreforkAgent, tell
> > it how many children to beget (degree of parallelization) and provide
> > it with a couple of callbacks as means of communication.
>
> Hu.. sounds pretty much like Parallel::ForkManager.

Now I got the chance to look at Parallel::ForkManager and get back on
this.

Well, the obvious difference is that PreforkAgent preforks while
Parallel::ForkManager does very much the same as fork(), only limiting
the child number and abstracting waitpid.
And as I wrote above
> > Children will live and be re-used until the job-queue is depleted.

While the Parallel::ForkManager is creating a new process on every job
(with all the performance overhead that involves), PreforkAgent does
no forking once the work 's been taken up and its children do exit
only after the last job was assigned.

The basic incentive for PreforkAgent.pm was making the most efficient
use of the host's ressources. (E. g., to wreak havoc with real big
application servers for the sake of load simulation.)

steffen


Similar ThreadsPosted
Calling functions by name and load modules on demand May 19, 2006, 4:20 am
Simulator using perl ? September 2, 2005, 4:04 pm
how to load a picture to an oracle database with the Load a pictureto Oracle with DBI perl module December 3, 2004, 3:37 pm
Book: Higher-Order Perl: Transforming Programs with Programs July 9, 2005, 5:11 pm
Re: Book: Higher-Order Perl: Transforming Programs with Programs July 9, 2005, 11:10 pm
network simulator - NS2 January 5, 2007, 1:14 pm
Load information in Solaris (Perl Script.) November 4, 2004, 6:09 pm
Need help with Perl and MySQL database data load January 14, 2005, 11:23 pm
load modules that are not part of the perl dist June 21, 2005, 3:03 pm
Load perl module dynamically (use $object) March 5, 2006, 12:36 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap