Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:23:01+00:00 2026-05-23T14:23:01+00:00

I was trying to find some documentation about worker thread reuse policy in web

  • 0

I was trying to find some documentation about worker thread reuse policy in web servers especially tomcat 6 but could not find anything easily, so bringing this up with the experts!

As per my understanding, a web serve uses a pool of worker threads to service http requests.

In our application, we do maintain some information in a map with key being the current Thread (sort of a round about way to do thread local).

We recently spotted a bug in our code where we were relying on the fact that when a session expired (for us configured to be 2 hours), our HttpSessionBindingListener implementing class would receive get the callback and in the method we would use the current thread to query the map and clean up some data. The issue with this approach is that web server would not always give you a worker thread which was associated to the same session 2 hours ago and therefore we were not doing the clean up properly.

After spotting this issue, I am actually confused about the scenario the other way. For us we have seen this code work 80% of the times i.e. getting a worker thread which cleans up the data correctly.

I am little confused on why this ever works? Can somone with knowledge of servlet container internals shed some light on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:23:01+00:00Added an answer on May 23, 2026 at 2:23 pm

    Since version 6 Tomcat’s thread pool is shared across different components: http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html

    The HTTP connector defines the maximum number of threads available to the connector: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

    Both default to 200.

    If you have a hit rate of +-80% today I suppose your application is not under heavy load for 80% of the time. E.g. in average Tomcat only uses 1.5 different threads out of the pool. I have no idea what may happen if you activate asyncronous IO (AIO) request processing. Recommendation: move to ThreadLocal or another e.g. session based solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to find some manual information on this, but my search is
I'm trying to find documentation on how one would go about creating a custom
I'm trying to find some good documentation (book, blog, mailing list etc) on how
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Am trying to find some text only if it contains english letters and numbers
I'm trying to find some references in regards to x86 Assembly languages. Tutorials/Examples to
I'm trying to find some info on the best and most common RESTful url
I have been trying to find some resource on this topic for a while
I have been trying to find some step by step guidance on how to
I'm trying to find some information on preferred solution setup when using MVC 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.