Perlbal - controlling number of perlbal processes

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > May 2006 > controlling number of perlbal processes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author controlling number of perlbal processes
Elliot F

2006-05-16, 7:11 pm

Hello all,

I was wondering why perlbal starts up as four processes. I grepped
through the distribution and most of the libraries, and the only forks I
find are under the deamonize method (~line 951 of lib/Perlbal.pm in 1.41).

What library is causing the fork, and what is the logic behind it?

The reason why I ask is that I am looking at using perlbal as the basis
of a small PERL application server (rather than writing my own from
scratch or using something like POE) for use in memory limited embedded
devices, and having the four processes seems to be unnecessary in my
requirements.

Thank you,

Elliot Foster

Mark Smith

2006-05-16, 7:11 pm

> What library is causing the fork, and what is the logic behind it?

What you're seeing is the IO processes that are spawned by
IO::AIO/Linux::AIO and are used for doing asynchronous IO. If you don't
have a need for doing file reading and are going to be generating your
own content, you can disable that:

SET aio_mode = none

(I believe... it's in the manual either way.) If you have that in your
config file, then Perlbal would only start up with the one process.

> The reason why I ask is that I am looking at using perlbal as the basis
> of a small PERL application server (rather than writing my own from
> scratch or using something like POE) for use in memory limited embedded
> devices, and having the four processes seems to be unnecessary in my
> requirements.


Sounds interesting. Good luck.


--
Mark Smith
mark@plogs.net

Elliot F

2006-05-16, 7:11 pm

Mark Smith wrote:
>
>
> What you're seeing is the IO processes that are spawned by
> IO::AIO/Linux::AIO and are used for doing asynchronous IO. If you don't
> have a need for doing file reading and are going to be generating your
> own content, you can disable that:
>
> SET aio_mode = none
>
> (I believe... it's in the manual either way.) If you have that in your
> config file, then Perlbal would only start up with the one process.


Thank you for the quick reply, but it does not appear to solve the
problem. I modified the webserver.conf example configuration file as such:

CREATE SERVICE docs
SET listen = 0.0.0.0:80
SET role = web_server
SET docroot = /usr/share/doc/
SET dirindexing = 1
SET persist_client = on
server aio_mode = none
ENABLE docs

# always good to keep an internal management port open:
CREATE SERVICE mgmt
SET role = management
SET listen = 127.0.0.1:60000
server aio_mode = none
ENABLE mgmt

Sure enough, perlbal tells me that aio is disabled on start:

$ sudo ./perlbal --config=conf/grat.conf
WARNING: AIO mode disabled or not available.
Perlbal will run slowly under load if you're doing any
disk operations. (e.g. web_server mode).
Running.
beginning run

But it is still running as four processes:

root 11239 24127 6 11:48 pts/2 00:00:00 /usr/bin/perl -w
../perlbal --config=conf/grat.conf
root 11243 11239 0 11:48 pts/2 00:00:00 /usr/bin/perl -w
../perlbal --config=conf/grat.conf
root 11244 11239 0 11:48 pts/2 00:00:00 /usr/bin/perl -w
../perlbal --config=conf/grat.conf
root 11245 11239 0 11:48 pts/2 00:00:00 /usr/bin/perl -w
../perlbal --config=conf/grat.conf

So I did an strace and found that it's still cloning the process. I
looked around and found that I was using Linux::AIO, I removed that and
started using IO::AIO, and I'm down to one process (for starters):

root 11861 24127 8 11:59 pts/2 00:00:00 /usr/bin/perl -w
../perlbal --config=conf/grat.conf

So even if it's configured to disabled aio, the process still sucks it
in (it appears.)

>
>
> Sounds interesting. Good luck.


Thanks, and thanks for the pointer!


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com