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 2021/02/11 13:09:02 UTC
[Bug 65136] New: Parallel deploy speedup with /manager/text servlet
not possible because of synchronized method ManagerServlet.deploy()
https://bz.apache.org/bugzilla/show_bug.cgi?id=65136
Bug ID: 65136
Summary: Parallel deploy speedup with /manager/text servlet not
possible because of synchronized method
ManagerServlet.deploy()
Product: Tomcat 9
Version: 9.0.x
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Manager
Assignee: dev@tomcat.apache.org
Reporter: mads@renxo.com
Target Milestone: -----
Hi, our system consists on about 80+ webapps on different servers.
Multiple webapps are deployed per Tomcat server remotely using the
manager and host-manager webapps.
This has been working fine for years, however some servers now have 5+
webapps and they are taking a long time to start. We invoke the deploy
command on the manager webapp in parallel for each webapp, in order to
attempt a reduction in total server startup time. However the speedup is
very modest. The servers have powerful Xeon multi-core servers so a
parallel speedup should be possible.
Looking at the source code for
org.apache.catalina.manager.ManagerServlet we see that the following
method is synchronized which would explain the behaviour we are seeing:
protected synchronized void deploy
(PrintWriter writer, String config, ContextName cn,
String tag, boolean update, HttpServletRequest request,
StringManager smClient) {
Is there any real reason why this needs to be synchronized? Tomcat can
deploy webapps in parallel when backgroundProcessorDelay is set to a
positive number, but this is not useful when remotely deploying webapps
using the manager webapp.
Any ideas? Thanks
--
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 65136] Parallel deploy speedup with /manager/text servlet not
possible because of synchronized method ManagerServlet.deploy()
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65136
--- Comment #1 from Manuel Dominguez Sarmiento <ma...@renxo.com> ---
Comments from Mark Thomas on the Tomcat User List dated January 7th 2021:
"Some svn archaeology uncovered this commit comment:
"Known issue: locking occurs on an uploaded WAR, for reasons which
elude me right now."
The method level sync looks like an attempt to ensure that there aren't
parallel attempts to deploy a web application to the same path. I can't
think of any other reason. But locking on, essentially, the virtual
host, seems overly broad. A lock on the deployment path would be sufficient.
There are also calls to isServiced(), addServiced() and removeServiced()
which look to be trying to do the same thing which have their own issues
(not atomic, uses a List rather than a Set).
We do need to ensure that we don't get parallel attempts to service the
same web application. There is scope for all sorts of bad things to
happen if that is possible.
Overall, I think this can be fixed but it looks like some API changes
are going to be required which makes things a little more complicated.
It would be worth you opening a Bugzilla issue for this to make sure it
doesn't get forgotten about. The issues with the unsynchronized
deployment methods are sufficient - in my view - to class this as a bug
rather than an enhancement.
Mark"
--
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 65136] Parallel deploy speedup with /manager/text servlet not
possible because of synchronized method ManagerServlet.deploy()
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65136
--- Comment #4 from Remy Maucherat <re...@apache.org> ---
The improvement will be in Tomcat 10.0.3, 9.0.44 and 8.5.64.
--
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 65136] Parallel deploy speedup with /manager/text servlet not
possible because of synchronized method ManagerServlet.deploy()
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65136
Remy Maucherat <re...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Severity|normal |enhancement
--- Comment #2 from Remy Maucherat <re...@apache.org> ---
https://github.com/apache/tomcat/commit/ee6069392752f930c64e160a6a08a9904ffea008
--
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 65136] Parallel deploy speedup with /manager/text servlet not
possible because of synchronized method ManagerServlet.deploy()
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65136
--- Comment #3 from Manuel Dominguez Sarmiento <ma...@renxo.com> ---
Thanks Remy, I now see that Mark has been already working on this and committed
7 patches to resolve this issue. I see that these commits were made right after
the release of 9.0.43 (Feb. 1st while 9.0.43 was release on Jan. 28th)
I assume these fixes will be available on 9.0.44 right? I'm unsure whether they
were just applies to the 10.x or backported to the 9.x branch as well.
Thanks
--
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