You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2017/06/23 12:53:06 UTC
[Bug 61212] New: Slow application boot time due to constant jar file
content read
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
Bug ID: 61212
Summary: Slow application boot time due to constant jar file
content read
Product: Tomcat 8
Version: 8.5.15
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: abruzgulis@eisgroup.com
Target Milestone: ----
Created attachment 35071
--> https://bz.apache.org/bugzilla/attachment.cgi?id=35071&action=edit
Profile Before
We do have relativelly big spring based application with ~250mb of jars.
After migrating from tc 7 to tc 8 application boot time significantly
increased. Seems that most of the time is taken by a constant call to
java.util.jar.JarFile.getJarEntry.
Looks like tc8 class/resource loaded on each ClassLoader.loadClass(String)
iterates throught all jars and asked each jar if resource exists instead of
caching jar content once in memmory.
tc 8 has the ability to read jar contens only once but to enable it we had to
extend org.apache.catalina.webresources.StandardRoot iwth custom
implementation.
After change total time spent on
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(String) dropped from
87sec to 39sec. It was 40+sec of time wasted on constant jar content check.
package org.apache.catalina.webresources;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.WebResourceSet;
/**
* Created by adi on 09/06/2017.
*/
public class CustomStandardRoot extends
org.apache.catalina.webresources.StandardRoot {
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
for (WebResourceSet webResourceSet : getClassResources()) {
if (webResourceSet instanceof AbstractArchiveResourceSet) {
// Load Jar Content into Memory
((AbstractArchiveResourceSet)webResourceSet).getArchiveEntries(false);
}
}
}
}
and register custom implementation in TOMCAT_HOME/conf/context.xml
<?xml version="1.0" encoding="UTF-8"?>
Context containerSciFilter="org.apache.tomcat.websocket.server.WsSci">
...
<Resources cachingAllowed="true"
className="org.apache.catalina.webresources.CustomStandardRoot"/>
...
</Context>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
Sebastien Tardif <Se...@ncf.ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |SebTardif@ncf.ca
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #3 from Mark Thomas <ma...@apache.org> ---
*** This bug has been marked as a duplicate of bug 60963 ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
--- Comment #4 from Adrianas <ab...@eisgroup.com> ---
We face this issue with unpacked war so I'm not sure if this is a duplicate
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
Adrianas <ab...@eisgroup.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #35072|After |Profile After
description| |
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
--- Comment #6 from Adrianas <ab...@eisgroup.com> ---
We checked all FasterStartUp hints none of them gave material improvement.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
--- Comment #2 from Adrianas <ab...@eisgroup.com> ---
We do have relativelly big spring based application with ~250mb of jars.
After migrating from tc 7 to tc 8 application boot time significantly
increased. Seems that most of the time is taken by a constant call to
java.util.jar.JarFile.getJarEntry.
Looks like tc8 class/resource loader on each ClassLoader.loadClass(String)
iterates through all jars and asks each jar if resource exists (instead of
caching jar content once in memory).
tc 8 has the ability to read jar contens only once but to enable it we had to
extend org.apache.catalina.webresources.StandardRoot with custom
implementation.
After change total time spent on
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(String) dropped from
87sec to 39sec. It was 40+sec of time wasted on constant jar content check.
package org.apache.catalina.webresources;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.WebResourceSet;
/**
* Created by adi on 09/06/2017.
*/
public class CustomStandardRoot extends
org.apache.catalina.webresources.StandardRoot {
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
for (WebResourceSet webResourceSet : getClassResources()) {
if (webResourceSet instanceof AbstractArchiveResourceSet) {
// Load Jar Content into Memory
((AbstractArchiveResourceSet)webResourceSet).getArchiveEntries(false);
}
}
}
}
and register custom implementation in TOMCAT_HOME/conf/context.xml
<?xml version="1.0" encoding="UTF-8"?>
Context containerSciFilter="org.apache.tomcat.websocket.server.WsSci">
...
<Resources cachingAllowed="true"
className="org.apache.catalina.webresources.CustomStandardRoot"/>
...
</Context>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
--- Comment #5 from Mark Thomas <ma...@apache.org> ---
Slow startup issues with unpacked web applications are most likely a
configuration issue.
See https://wiki.apache.org/tomcat/HowTo/FasterStartUp and follow up on the
users list if you need further assistance.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 61212] Slow application boot time due to constant jar file
content read
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61212
--- Comment #1 from Adrianas <ab...@eisgroup.com> ---
Created attachment 35072
--> https://bz.apache.org/bugzilla/attachment.cgi?id=35072&action=edit
After
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org