You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Alex Bolgarov <al...@gmail.com> on 2009/05/21 15:41:49 UTC

Re: mod_axis and apache problem: starting apache loads 4 instances of web service

On Thu, May 21, 2009 at 10:34 AM, Abdul Sami <as...@folio3.com> wrote:
>
> I have built a web service using axis2/c's latest framework. After
> configuring Mod_Axis with apache, i noticed that it is loading 4 different
> instances of service. How can i control it?

May it be because the Apache launches 4 server processes? (and each
process has to load it's own instance of the shared library that
implements the service?) If this is so, then you probably would be
able to configure how much processes Apache starts, and min. and max.
restrictions on the number of the processes Apache is allowed to run,
in the Apache config.


Thank you,

    alex.

Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Abdul Sami <as...@folio3.com>.
The service is asynchronous due to external resources, the thread has to 
wait for some time before it can actually process the request. I think i 
should either separate the consumer thread to a stand alone service, or 
make it work with other instances of threads as well.

I have also noted that my 'free' function of Axis Svc Skeleton is not 
being called on stopping Apache. When it is called?

Uthaiyashankar wrote:

> On Fri, May 22, 2009 at 12:22 PM, Abdul Sami <as...@folio3.com> wrote:
>   
>> Uthaiyashankar wrote:
>>     
>>> Each instance will load their own service library and serve from them,
>>> but they will load only once. What do you want to achieve? If you want
>>> to share some data between consecutive requests, then you can enable
>>> shared global pool [1] .
>>>
>>> Regards,
>>> Shankar.
>>>
>>> [1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#mod_axis2
>>>
>>>
>>>       
>> What effect the Shared global pool will have on the Service? I have a Queue
>> and a consumer thread. I want to have only one consumer thread running.
>>     
>
> I am still not clear on your requirements. Why do you want to have
> only one consumer thread? If it is due to some other external factors,
> then shared global pool will not help. But what you want to achieve is
> to share a data between two requests, then you can do it using shared
> global pool..
>
> If the limitation is due to external factors, then you have to
> configure httpd as you specified in your mail. In that case, service
> library will be loaded once and all the requests will be served by
> that.
>
> Regards,
> Shankar.
>
>
>   
>>     
>
>
>
>   


Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Uthaiyashankar <sh...@wso2.com>.
On Fri, May 22, 2009 at 12:22 PM, Abdul Sami <as...@folio3.com> wrote:
> Uthaiyashankar wrote:
>>
>> Each instance will load their own service library and serve from them,
>> but they will load only once. What do you want to achieve? If you want
>> to share some data between consecutive requests, then you can enable
>> shared global pool [1] .
>>
>> Regards,
>> Shankar.
>>
>> [1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#mod_axis2
>>
>>
>
> What effect the Shared global pool will have on the Service? I have a Queue
> and a consumer thread. I want to have only one consumer thread running.

I am still not clear on your requirements. Why do you want to have
only one consumer thread? If it is due to some other external factors,
then shared global pool will not help. But what you want to achieve is
to share a data between two requests, then you can do it using shared
global pool..

If the limitation is due to external factors, then you have to
configure httpd as you specified in your mail. In that case, service
library will be loaded once and all the requests will be served by
that.

Regards,
Shankar.


>
>



-- 
S.Uthaiyashankar
Software Architect
WSO2 Inc.
http://wso2.com/ - "The Open Source SOA Company"

Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Abdul Sami <as...@folio3.com>.
Uthaiyashankar wrote:
> Each instance will load their own service library and serve from them,
> but they will load only once. What do you want to achieve? If you want
> to share some data between consecutive requests, then you can enable
> shared global pool [1] .
>
> Regards,
> Shankar.
>
> [1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#mod_axis2
>
>   
What effect the Shared global pool will have on the Service? I have a 
Queue and a consumer thread. I want to have only one consumer thread 
running.


Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Uthaiyashankar <sh...@wso2.com>.
On Fri, May 22, 2009 at 10:51 AM, Abdul Sami <as...@folio3.com> wrote:
> With ServerLimit 1, only one service instance is being loaded at startup.
>
> This leads me to confirm the behavior of both axis2_http_server and
> mod_axis. Do they serve each request from independently loaded Soap service
> library, or they can share a loaded library among multiple requests?

Each instance will load their own service library and serve from them,
but they will load only once. What do you want to achieve? If you want
to share some data between consecutive requests, then you can enable
shared global pool [1] .

Regards,
Shankar.

[1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#mod_axis2


>
>
> Sam Carleton wrote:
>
> Abdul Sami wrote:
>
> Okay i have set 'ServerLimit 1', this solves it.
>
> The idea is that as requests come in the master instance of Apache will
> spawn more instances as the demand goes up.  You are going to experience
> some series performance issues if you do that in production.  If I am not
> mistaken, even with ServerLimit 1, there will be two:  one for the master,
> and the one that does the work...
>
> There is a -X option to start apache for development/debugging things, it
> will NOT spawn ANY more processes.  I am assuming that is what you are
> really after.
>
> Sam
>
>



-- 
S.Uthaiyashankar
Software Architect
WSO2 Inc.
http://wso2.com/ - "The Open Source SOA Company"

Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Abdul Sami <as...@folio3.com>.
With ServerLimit 1, only one service instance is being loaded at startup.

This leads me to confirm the behavior of both axis2_http_server and 
mod_axis. Do they serve each request from independently loaded Soap 
service library, or they can share a loaded library among multiple requests?


Sam Carleton wrote:
> Abdul Sami wrote:
>> Okay i have set 'ServerLimit 1', this solves it.
> The idea is that as requests come in the master instance of Apache 
> will spawn more instances as the demand goes up.  You are going to 
> experience some series performance issues if you do that in 
> production.  If I am not mistaken, even with ServerLimit 1, there will 
> be two:  one for the master, and the one that does the work...
>
> There is a -X option to start apache for development/debugging things, 
> it will NOT spawn ANY more processes.  I am assuming that is what you 
> are really after.
>
> Sam


Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Sam Carleton <sc...@gmail.com>.
Abdul Sami wrote:
> Okay i have set 'ServerLimit 1', this solves it.
The idea is that as requests come in the master instance of Apache will 
spawn more instances as the demand goes up.  You are going to experience 
some series performance issues if you do that in production.  If I am 
not mistaken, even with ServerLimit 1, there will be two:  one for the 
master, and the one that does the work...

There is a -X option to start apache for development/debugging things, 
it will NOT spawn ANY more processes.  I am assuming that is what you 
are really after.

Sam

Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Abdul Sami <as...@folio3.com>.
Okay i have set 'ServerLimit 1', this solves it.

Abdul Sami wrote:
> What directives in the httpd.conf define this settings. i am unable to 
> see any
>
> Alex Bolgarov wrote:
>> On Thu, May 21, 2009 at 10:34 AM, Abdul Sami <as...@folio3.com> wrote:
>>   
>>> I have built a web service using axis2/c's latest framework. After
>>> configuring Mod_Axis with apache, i noticed that it is loading 4 different
>>> instances of service. How can i control it?
>>>     
>>
>> May it be because the Apache launches 4 server processes? (and each
>> process has to load it's own instance of the shared library that
>> implements the service?) If this is so, then you probably would be
>> able to configure how much processes Apache starts, and min. and max.
>> restrictions on the number of the processes Apache is allowed to run,
>> in the Apache config.
>>
>>
>> Thank you,
>>
>>     alex.
>>
>>   
>


Re: mod_axis and apache problem: starting apache loads 4 instances of web service

Posted by Abdul Sami <as...@folio3.com>.
What directives in the httpd.conf define this settings. i am unable to 
see any

Alex Bolgarov wrote:
> On Thu, May 21, 2009 at 10:34 AM, Abdul Sami <as...@folio3.com> wrote:
>   
>> I have built a web service using axis2/c's latest framework. After
>> configuring Mod_Axis with apache, i noticed that it is loading 4 different
>> instances of service. How can i control it?
>>     
>
> May it be because the Apache launches 4 server processes? (and each
> process has to load it's own instance of the shared library that
> implements the service?) If this is so, then you probably would be
> able to configure how much processes Apache starts, and min. and max.
> restrictions on the number of the processes Apache is allowed to run,
> in the Apache config.
>
>
> Thank you,
>
>     alex.
>
>