You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Rees <dr...@gmail.com> on 2012/01/23 22:11:20 UTC

Re: parallel webapp initialization

On Tue, Oct 11, 2011 at 6:42 AM, Mark Thomas <ma...@apache.org> wrote:
> I have added a patch based on the previous patches that adds:
> - threaded start/stop for Contexts
> - threaded start/stop for Hosts
> - threaded deployment
>
> Control over the number of threads is via server.xml and/or JMX. This
> can be changed dynamically.
>
> Review, feedback, testing etc. welcome.
>
> With 4 threads rather than the current 1 (on a 8-core machine), I saw a
> 20-25% improvement in start time with a large number of Contexts that
> all start quickly. I'd expect to see better results in situations where
> 1 few Contexts start slowly but most are quick.

Resurrecting an old thread, but I've started using this in Tomcat
7.0.25 with good results - have a Tomcat instance used for testing
with a couple dozen contexts that take a while to load each, but with
startStopThreads bumped up it reduces startup time from 60 seconds to
20 seconds using all available CPU cores.  Very helpful!

Thanks!

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: parallel webapp initialization

Posted by Pid <pi...@pidster.com>.
On 26/01/2012 06:52, David Rees wrote:
> On Wed, Jan 25, 2012 at 1:24 AM, Pid <pi...@pidster.com> wrote:
>> On 24/01/2012 21:01, David Rees wrote:
>>> The system has 8 CPU cores, Opteron 2378 CPU.  Going beyond 4
>>> startStopThreads for the host where the webapps are deployed doesn't
>>> speed things up much more as it appears that the webapps can use up to
>>> 2 cores when initializing as seen in single threaded startup mode.
>>
>> In single threaded startup mode, the process uses 2 cores?
> 
> Yes - I haven't traced exactly what the application is doing during
> startup, but you can see that CPU usage is somewhere between 100-190%
> or so during startup.
> 
>> You refer to system and host separately, is it virtualised?
> 
> No - by host I meant <Host/> in the Tomcat configuration.

Gotcha.   Good info, thanks.


p


-- 

[key:62590808]


Re: parallel webapp initialization

Posted by David Rees <dr...@gmail.com>.
On Wed, Jan 25, 2012 at 1:24 AM, Pid <pi...@pidster.com> wrote:
> On 24/01/2012 21:01, David Rees wrote:
>> The system has 8 CPU cores, Opteron 2378 CPU.  Going beyond 4
>> startStopThreads for the host where the webapps are deployed doesn't
>> speed things up much more as it appears that the webapps can use up to
>> 2 cores when initializing as seen in single threaded startup mode.
>
> In single threaded startup mode, the process uses 2 cores?

Yes - I haven't traced exactly what the application is doing during
startup, but you can see that CPU usage is somewhere between 100-190%
or so during startup.

> You refer to system and host separately, is it virtualised?

No - by host I meant <Host/> in the Tomcat configuration.

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: parallel webapp initialization

Posted by Pid <pi...@pidster.com>.
On 24/01/2012 21:01, David Rees wrote:
> On Mon, Jan 23, 2012 at 11:53 PM, Pid * <pi...@pidster.com> wrote:
>> On 23 Jan 2012, at 21:12, David Rees <dr...@gmail.com> wrote:
>>> On Tue, Oct 11, 2011 at 6:42 AM, Mark Thomas <ma...@apache.org> wrote:
>>>> I have added a patch based on the previous patches that adds:
>>>> - threaded start/stop for Contexts
>>>> - threaded start/stop for Hosts
>>>> - threaded deployment
>>>>
>>>> Control over the number of threads is via server.xml and/or JMX. This
>>>> can be changed dynamically.
>>>>
>>>> Review, feedback, testing etc. welcome.
>>>>
>>>> With 4 threads rather than the current 1 (on a 8-core machine), I saw a
>>>> 20-25% improvement in start time with a large number of Contexts that
>>>> all start quickly. I'd expect to see better results in situations where
>>>> 1 few Contexts start slowly but most are quick.
>>>
>>> Resurrecting an old thread, but I've started using this in Tomcat
>>> 7.0.25 with good results - have a Tomcat instance used for testing
>>> with a couple dozen contexts that take a while to load each, but with
>>> startStopThreads bumped up it reduces startup time from 60 seconds to
>>> 20 seconds using all available CPU cores.  Very helpful!
>>
>> That's great - and thanks for letting us know.
>>
>> If you have time, I think it would be interesting to know your
>> application sizes, individual startup time and how many
>> startStopThreads you are using.
> 
> On this example there's about 30 webapps, each war file ranges between
> 30-60MB.  Single threaded startup, each application takes about 2
> seconds to start up.  This is on a warm restart, webapps already
> deployed, cold restarts are slower if the server has to read from
> disk.

Awesome, thanks.

> The system has 8 CPU cores, Opteron 2378 CPU.  Going beyond 4
> startStopThreads for the host where the webapps are deployed doesn't
> speed things up much more as it appears that the webapps can use up to
> 2 cores when initializing as seen in single threaded startup mode.

In single threaded startup mode, the process uses 2 cores?

You refer to system and host separately, is it virtualised?

> Going to 6 threads pretty much maxed it out, but I've left it set to 7.

:)


p


-- 

[key:62590808]


Re: parallel webapp initialization

Posted by David Rees <dr...@gmail.com>.
On Mon, Jan 23, 2012 at 11:53 PM, Pid * <pi...@pidster.com> wrote:
> On 23 Jan 2012, at 21:12, David Rees <dr...@gmail.com> wrote:
>> On Tue, Oct 11, 2011 at 6:42 AM, Mark Thomas <ma...@apache.org> wrote:
>>> I have added a patch based on the previous patches that adds:
>>> - threaded start/stop for Contexts
>>> - threaded start/stop for Hosts
>>> - threaded deployment
>>>
>>> Control over the number of threads is via server.xml and/or JMX. This
>>> can be changed dynamically.
>>>
>>> Review, feedback, testing etc. welcome.
>>>
>>> With 4 threads rather than the current 1 (on a 8-core machine), I saw a
>>> 20-25% improvement in start time with a large number of Contexts that
>>> all start quickly. I'd expect to see better results in situations where
>>> 1 few Contexts start slowly but most are quick.
>>
>> Resurrecting an old thread, but I've started using this in Tomcat
>> 7.0.25 with good results - have a Tomcat instance used for testing
>> with a couple dozen contexts that take a while to load each, but with
>> startStopThreads bumped up it reduces startup time from 60 seconds to
>> 20 seconds using all available CPU cores.  Very helpful!
>
> That's great - and thanks for letting us know.
>
> If you have time, I think it would be interesting to know your
> application sizes, individual startup time and how many
> startStopThreads you are using.

On this example there's about 30 webapps, each war file ranges between
30-60MB.  Single threaded startup, each application takes about 2
seconds to start up.  This is on a warm restart, webapps already
deployed, cold restarts are slower if the server has to read from
disk.

The system has 8 CPU cores, Opteron 2378 CPU.  Going beyond 4
startStopThreads for the host where the webapps are deployed doesn't
speed things up much more as it appears that the webapps can use up to
2 cores when initializing as seen in single threaded startup mode.

Going to 6 threads pretty much maxed it out, but I've left it set to 7.

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: parallel webapp initialization

Posted by Pid * <pi...@pidster.com>.
On 23 Jan 2012, at 21:12, David Rees <dr...@gmail.com> wrote:

> On Tue, Oct 11, 2011 at 6:42 AM, Mark Thomas <ma...@apache.org> wrote:
>> I have added a patch based on the previous patches that adds:
>> - threaded start/stop for Contexts
>> - threaded start/stop for Hosts
>> - threaded deployment
>>
>> Control over the number of threads is via server.xml and/or JMX. This
>> can be changed dynamically.
>>
>> Review, feedback, testing etc. welcome.
>>
>> With 4 threads rather than the current 1 (on a 8-core machine), I saw a
>> 20-25% improvement in start time with a large number of Contexts that
>> all start quickly. I'd expect to see better results in situations where
>> 1 few Contexts start slowly but most are quick.
>
> Resurrecting an old thread, but I've started using this in Tomcat
> 7.0.25 with good results - have a Tomcat instance used for testing
> with a couple dozen contexts that take a while to load each, but with
> startStopThreads bumped up it reduces startup time from 60 seconds to
> 20 seconds using all available CPU cores.  Very helpful!

That's great - and thanks for letting us know.

If you have time, I think it would be interesting to know your
application sizes, individual startup time and how many
startStopThreads you are using.


p

>
> Thanks!
>
> -Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org