You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Praveen Bhaniramka <pr...@sgi.com> on 2006/01/19 08:26:08 UTC

Thread-only execution with Apache 2 : Newbie query

Hi all,

We are developing a custom module for Apache using mod_gsoap over Linux.
However, our software currently does not work very well in a
multi-process environment as it was designed primarily for a
multi-threaded environment.

Is there a way to configure Apache such that it uses threads only
instead of using processes for handling HTTP requests? I looked at the
Apache documentation and it seems that the default MPM modules, prefork
and worker, use processes by default. The worker module seems to allow
both models of execution. Is it possible to configure it to use threads
only? 

Thanks for any useful pointers.

Regards,
Praveen


Re: Thread-only execution with Apache 2 : Newbie query

Posted by Joshua Slive <jo...@slive.ca>.
On 1/19/06, Praveen Bhaniramka <pr...@sgi.com> wrote:
> Hi Joshua,
>
> Thanks for your reply. I tried setting the parameters suggested by you.
> But when I re-run httpd2, I see that it is still creating 3 processes.

Three processes is normal.  One is the control process, one is the cgi
daemon and one is the main server process.  Only the latter should be
serving requests.

Joshua.

RE: Thread-only execution with Apache 2 : Newbie query

Posted by Praveen Bhaniramka <pr...@sgi.com>.
Hi Joshua,

Thanks for your reply. I tried setting the parameters suggested by you.
But when I re-run httpd2, I see that it is still creating 3 processes. 

> Yes, worker should be able to do this, although it will not adjust to
> load (you need to prespecify exactly how many threads will be
> available at all times).  Something like:
> ServerLimit 1
> StartServer 1
> MaxClients 512
> ThreadsPerChild 512
> MaxSpareThreads 512
> MinSpareThreads 0

mangal ~ -> ps -ef | grep httpd
root     15588     1  1 21:04 ?        00:00:00 httpd2 -k restart
wwwrun   15589 15588  0 21:04 ?        00:00:00 httpd2 -k restart
wwwrun   15590 15588  0 21:04 ?        00:00:00 httpd2 -k restart

My server-tuning.conf file looks like the following - 
# worker MPM
<IfModule worker.c>
        ServerLimit         1
        # initial number of server processes to start
        StartServers         1
        # minimum number of worker threads which are kept spare
        MinSpareThreads     25
        # maximum number of worker threads which are kept spare
        MaxSpareThreads     75
        # maximum number of simultaneous client connections
        MaxClients         25
        # constant number of worker threads in each server process
        ThreadsPerChild     25
        # maximum number of requests a server process serves
        MaxRequestsPerChild  0
</IfModule>

Any idea what might be going on? 

- Praveen


Re: Thread-only execution with Apache 2 : Newbie query

Posted by Joshua Slive <jo...@slive.ca>.
On 1/19/06, Praveen Bhaniramka <pr...@sgi.com> wrote:
> Hi all,
>
> We are developing a custom module for Apache using mod_gsoap over Linux.
> However, our software currently does not work very well in a
> multi-process environment as it was designed primarily for a
> multi-threaded environment.
>
> Is there a way to configure Apache such that it uses threads only
> instead of using processes for handling HTTP requests? I looked at the
> Apache documentation and it seems that the default MPM modules, prefork
> and worker, use processes by default. The worker module seems to allow
> both models of execution. Is it possible to configure it to use threads
> only?
>
> Thanks for any useful pointers.

Yes, worker should be able to do this, although it will not adjust to
load (you need to prespecify exactly how many threads will be
available at all times).  Something like:
ServerLimit 1
StartServer 1
MaxClients 512
ThreadsPerChild 512
MaxSpareThreads 512
MinSpareThreads 0

Joshua.