On Tue, 2009-06-23 20:52:30 -0400, Terry Riegel wrote:
>
> On Jun 23, 2009, at 11:01 AM, Ludolf Holzheid <lholzheid(a)bihl-wiedemann.de
> > wrote:
> >
> >On Tue, 2009-06-23 10:33:14 -0400, Terry Riegel wrote:
> >>
> >>If I did it the way you are suggesting then 5 concurrent users would
> >>fire up 30 processes. On my system starting the daemon starts 6
> >>processes, and if I start it up again I get another 6 processes.
> >
> >Is this still true with 'foreground = yes'?
>
> Yes.
You are right. On detaching to the background, there is an additional
fork(), but the parent dies early. So the number of persistent
processes is the same.
> >For reducing the number of processes, you might also try to configure
> >stunnel with --disable-libwrap.
>
> I can try that wasn't aware of it as a configuration option
There is also a '--with-threads=pthread' option that may help to lower
the number of processes.
However, on modern operating systems, fork()ing is not as expensive as
it looks like. In most cases, the text segment is shared between the
two processes and the pages on data/BSS segments are not copied until
changed ('copy-on-write'). I don't know if the usage of OS resources
is larger for the multi-threaded or the multi-tasked approach.
Ludolf
P.S.: Please reply to the list, so the community is able to follow all
of the thread.
--
---------------------------------------------------------------
Ludolf Holzheid Tel: +49 621 339960
Bihl+Wiedemann GmbH Fax: +49 621 3392239
Floßwörthstraße 41 e-mail: lholzheid(a)bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------