Tomcat startup time

180 views
Skip to first unread message

Andrew Dixon

unread,
Apr 29, 2015, 10:55:50 AM4/29/15
to lu...@googlegroups.com
Hi All,

Does anyone know (Jordan, Denny maybe???) why Tomcat takes so long to startup? I have a Linux server with 5 contexts on it and the Tomcat startup time is around 150 seconds, so about 2 1/2 minutes, this seems crazy to me. I've tried some of the suggestions from this page:


But to be honest they made pretty much no difference. I'm running on Tomcat 7 with Tomcat Native installed and Java 1.7. This is an install from the Railo installer that was updated to Lucee, but the startup time has always been like this, not just since I updated to Lucee. I'm sure when I previously used Resin (years ago) it's startup time was seconds, no more than 4 or 5, not minutes.

Thanks.

Kind regards,

Andrew
about.me
mso - Lucee - Member

Julian Halliwell

unread,
Apr 29, 2015, 11:07:34 AM4/29/15
to lu...@googlegroups.com
Hi Andrew

I followed Gavin's instructions here:

http://www.gpickin.com/index.cfm/blog/how-to-get-your-tomcat-to-pounce-on-startup-not-crawl

and was able to reduce my startup times down from around 150 seconds
to under 15.

Julian.

Tony Junkes

unread,
Apr 29, 2015, 11:30:26 AM4/29/15
to lu...@googlegroups.com
+1 to Julian's reply regarding Gavin's article. The JarScanner in Tomcat can really make the contexts crawl at startup.

I've personally been running with it set to false for a while now and have had no issues alongside the faster start times.

I also looked at the startStopThreads attribute for each context and tested with various thread counts and also by setting its value to -1 but the gain in decreasing startup was minimal.

Andrew Dixon

unread,
Apr 29, 2015, 11:33:06 AM4/29/15
to lu...@googlegroups.com
Thanks, I will take a look.

Kind regards,

Andrew
about.me
mso - Lucee - Member


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/35803b02-9b70-43c7-bea4-8520d68413bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gert Franz

unread,
Apr 29, 2015, 12:12:59 PM4/29/15
to lu...@googlegroups.com
Also, always check whether there is a permission issue. Sometimes Lucee tries to create files in places it has no right to do so. That happened with JPL a while ago and we had a 300s startup time there and then with the correct rights, we were able to bring it down to 6s.

Sincerely
Gert Franz


RASIA GmbH
Spittelgasse 7
5103 Moeriken-Wildegg
Email: ge...@rasia.ch
Skype: gert.franz
Phone Switzerland: +41 76 5680 231


-----Ursprüngliche Nachricht-----
Von: lu...@googlegroups.com [mailto:lu...@googlegroups.com] Im Auftrag von Julian Halliwell
Gesendet: Mittwoch, 29. April 2015 17:07
An: lu...@googlegroups.com
Betreff: Re: [Lucee] Tomcat startup time
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAC_5Vorsj1gcrjadb00demRZrAv9aeJuCtyXEmn6G%2B48YN2B-w%40mail.gmail.com.

Konstantinos Liakos

unread,
Apr 29, 2015, 2:50:15 PM4/29/15
to lu...@googlegroups.com
The jarsToskip makes all the difference. Follow Gavin's article.

Igal @ Lucee.org

unread,
Apr 29, 2015, 7:12:32 PM4/29/15
to lu...@googlegroups.com
The jarsToskip makes all the difference.
+1

in Tomcat/conf/catalina.properties set:

    tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar


Igal Sapir
Lucee Core Developer
Lucee.org

Jordan Michaels

unread,
Apr 29, 2015, 7:40:34 PM4/29/15
to lu...@googlegroups.com
Is this something that should be configured by default in the installers?

Warm Regards,
Jordan Michaels

On 04/29/2015 04:12 PM, Igal @ Lucee.org wrote:
>> The jarsToskip makes all the difference.
> +1
>
> in Tomcat/conf/catalina.properties set:
>
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar
>
>
> Igal Sapir
> Lucee Core Developer
> Lucee.org <http://lucee.org/>
>
> On 4/29/2015 11:50 AM, Konstantinos Liakos wrote:
>> The jarsToskip makes all the difference. Follow Gavin's article.
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lucee+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org
> <https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org?utm_medium=email&utm_source=footer>.

Igal Sapir

unread,
Apr 29, 2015, 7:47:59 PM4/29/15
to lu...@googlegroups.com

Yep.

To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/55416BEF.5000502%40viviotech.net.

Jordan Michaels

unread,
Apr 29, 2015, 8:14:02 PM4/29/15
to lu...@googlegroups.com
https://github.com/utdream/CFML-Installers/issues/65

Warm Regards,
Jordan Michaels

On 04/29/2015 04:47 PM, Igal Sapir wrote:
> Yep.
>
> On Apr 29, 2015 16:40, "Jordan Michaels" <jor...@viviotech.net
> <mailto:jor...@viviotech.net>> wrote:
>
> Is this something that should be configured by default in the
> installers?
>
> Warm Regards,
> Jordan Michaels
>
> On 04/29/2015 04:12 PM, Igal @ Lucee.org wrote:
>
> The jarsToskip makes all the difference.
>
> +1
>
> in Tomcat/conf/catalina.properties set:
>
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar
>
>
> Igal Sapir
> Lucee Core Developer
> Lucee.org <http://lucee.org/>
>
> On 4/29/2015 11:50 AM, Konstantinos Liakos wrote:
>
> The jarsToskip makes all the difference. Follow Gavin's article.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from
> it, send
> an email to lucee+un...@googlegroups.com
> <mailto:lucee%2Bunsu...@googlegroups.com>
> <mailto:lucee+un...@googlegroups.com
> <mailto:lucee%2Bunsu...@googlegroups.com>>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>
> <mailto:lu...@googlegroups.com <mailto:lu...@googlegroups.com>>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org
> <https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to lucee+un...@googlegroups.com
> <mailto:lucee%2Bunsu...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lucee+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/CA%2Bzig0-F0mHLvd66nxi6DVxwPPhxQieCi8dSQd6SQ6yQ-SS0Wg%40mail.gmail.com
> <https://groups.google.com/d/msgid/lucee/CA%2Bzig0-F0mHLvd66nxi6DVxwPPhxQieCi8dSQd6SQ6yQ-SS0Wg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Andrew Dixon

unread,
Apr 30, 2015, 4:10:47 AM4/30/15
to lu...@googlegroups.com
Not tried this on my production machine yet, but on my dev machine, running Tomcat 7.0.59 I had to change three properties, as Gavin describes:

org.apache.catalina.startup.ContextConfig.jarsToSkip=*
org.apache.catalina.startup.TldConfig.jarsToSkip=*
tomcat.util.scan.DefaultJarScanner.jarsToSkip=*

This took the time from around 60 seconds to 18 - 20 seconds, which is better but still seems quite slow. I will try my production machine later and report back on that.

Kind regards,

Andrew
about.me
mso - Lucee - Member

To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/554173C7.6060109%40viviotech.net.

Konstantinos Liakos

unread,
Apr 30, 2015, 4:13:54 AM4/30/15
to lu...@googlegroups.com
How many contexts do you have? For 5-6 contexts this time is fairly good for a medium range dev machine.
        <mailto:lucee%2Bu...@googlegroups.com>
        <mailto:lucee+un...@googlegroups.com
        <mailto:lucee%2Bu...@googlegroups.com>>.

        To post to this group, send email to lu...@googlegroups.com
        <mailto:lu...@googlegroups.com>
        <mailto:lu...@googlegroups.com <mailto:lu...@googlegroups.com>>.
        To view this discussion on the web visit
        https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org
        <https://groups.google.com/d/msgid/lucee/55416552.9040304%40lucee.org?utm_medium=email&utm_source=footer>.
        For more options, visit https://groups.google.com/d/optout.


    --
    You received this message because you are subscribed to the Google
    Groups "Lucee" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to lucee+un...@googlegroups.com

    To post to this group, send email to lu...@googlegroups.com
    <mailto:lu...@googlegroups.com>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/lucee/55416BEF.5000502%40viviotech.net.
    For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com
<mailto:lucee+un...@googlegroups.com>.
To post to this group, send email to lu...@googlegroups.com
<mailto:lu...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/CA%2Bzig0-F0mHLvd66nxi6DVxwPPhxQieCi8dSQd6SQ6yQ-SS0Wg%40mail.gmail.com
<https://groups.google.com/d/msgid/lucee/CA%2Bzig0-F0mHLvd66nxi6DVxwPPhxQieCi8dSQd6SQ6yQ-SS0Wg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

Andrew Dixon

unread,
Apr 30, 2015, 4:42:31 AM4/30/15
to lu...@googlegroups.com
Ok I have made the change on my production machine and it came down from 150 seconds to 50 seconds, so much better but still nearly a minute, so still not that happy with that. 

@Konstantinos - In production I have 6 contexts running on a m1.small AWS instance. On my dev machine (Macbook Pro 2.4Ghz i5) I have 9 contexts and it takes 20 seconds. I'm guessing therefore this is a resource issue. The only other difference is the production machine has New Relic installed as well, maybe this is part of the problem.

Kind regards,

Andrew
about.me
mso - Lucee - Member

Konstantinos Liakos

unread,
Apr 30, 2015, 4:51:47 AM4/30/15
to lu...@googlegroups.com
The performance on your dev machine is quite decent I think. Bear in mind that each context has to lookup all these files in the WEB-INF/lucee folder, so IMO the IO is pretty much the bottleneck.

For the live machine, m1 is previous generation and without ssd hard drive. It would be expected to have bad performance, but not that much I think.

--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/Z0MqvS7z9gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Konstantinos Liakos

Gert Franz

unread,
Apr 30, 2015, 5:05:30 AM4/30/15
to lu...@googlegroups.com
What I will do in the next days is to start Tomcat without Lucee in order to see where we could end at. Just to rule out a general Lucee issue...

Gert

Sent from somewhere on the road

Chris Blackwell

unread,
Apr 30, 2015, 5:26:46 AM4/30/15
to lu...@googlegroups.com
This reduced my startup times on one server from 15s --> 2s (15 lucee contexts) and on another from 8s --> 1s (3 lucee contexts)
skipping jar scanning should definitely be included in the installer config.

Andrew Dixon

unread,
Apr 30, 2015, 5:49:21 AM4/30/15
to lu...@googlegroups.com
It is previous generation, but it is running on SSD, but if IO is the bottleneck then I can see why. I'm going to upgrade to a newer generation machine once my reservation is up in a couple of months.

Kind regards,

Andrew
about.me
mso - Lucee - Member

Jamie Jackson

unread,
Apr 30, 2015, 7:05:03 AM4/30/15
to lu...@googlegroups.com

While we're talking I/O, and since Vagrant is becoming more prevalent, I wanted to point out how much difference one's method of folder sharing  can make: https://github.com/GM-Alex/vagrant-winnfsd/wiki/Benchmarking-winnfsd-vs-VirtualBox-Shared-Folders

Spoiler: NFS reduced my startup times from 390s to 45s (single context, and yes, skipping the scanned jars).

Thanks,
Jamie

Patrick Heppler

unread,
Apr 30, 2015, 7:59:23 AM4/30/15
to lu...@googlegroups.com
Great article. Result: 

INFORMATION: Server startup in 4089 ms

Just awesome!

Paul Klinkenberg

unread,
Apr 30, 2015, 6:37:41 PM4/30/15
to lu...@googlegroups.com
Hi guys,

Just so you know: in the next version of mod_cfml, the jar scanning for every new web context will be disabled by default.
To be continued...

Kind regards,

Paul Klinkenberg


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages