Bug 64157 - Tomcat 7 performance: enable tomcat to pre-start pool of min spare threads optionally
Summary: Tomcat 7 performance: enable tomcat to pre-start pool of min spare threads op...
Status: NEEDINFO
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-18 18:42 UTC by Torres Yang
Modified: 2020-02-25 09:44 UTC (History)
0 users



Attachments
Improved Tomcat 7 performance by allowing start min spare threads optionally (1.52 KB, patch)
2020-02-18 18:43 UTC, Torres Yang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torres Yang 2020-02-18 18:42:10 UTC
Hi Tomcat,

During our performance testing, we found out that tomcat 7 made a mistake on preStartMinSpareThread.

In Tomcat 6, tomcat doesn't pre-start and maintain a pool of min spare threads, instead thread pool increased as requests come in.

In Tomcat 7. tomcat made a mistake and pre-start and maintain a pool of min spare threads, which impacts the performance.

In details:

- In 2010, Tomcat added this commit to OPTIONALLY prestart the core numbers of workers https://github.com/apache/tomcat/commit/26fe8127fd51b9b09a8abefa43d63f1f02960e50#diff-aee166200d5b05354b92c2ba73a758f9 And defect track in Bugzila: https://bz.apache.org/bugzilla/show_bug.cgi?id=43642

- In 2017, Tomcat added this commit to ALWAYS prestart, ignoring the previous commit, probably by mistake https://github.com/apache/tomcat/commit/b0e35f94f5dbb24079d29afe0958a4ee02319927#diff-baa9c50854087e10ddd02bd58f546f2a 


This change contribute to tomcat performance degradation, and it would improved tomcat 7 if we are able to optionally start the min spare threads.


Here we attached a patch to solve this problem.
Comment 1 Torres Yang 2020-02-18 18:43:54 UTC
Created attachment 37024 [details]
Improved Tomcat 7 performance by allowing start min spare threads optionally
Comment 2 Remy Maucherat 2020-02-25 09:44:58 UTC
I don't understand why maintaining the set of min spare threads is bad or how it affects performance. Please provide metrics.