This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Glassfish: specify thread pool for a webapp

Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the canonical way in Glassfish v2 to specify a thread pool for a specific application?

The Glassfish documentation is clear on how you create, edit and delete thread pools,
but say nothing on how you actually use them.

The default thread pool max size is 5, but there's (by default) another one named 'thread-pool-1'
with max size 200. I want to use that for my web/ejb3 app; I get thread starvation when several
clients simultaneously upload large files over a slow net.

Is that possible to specify via the Admin Console, or do you have to manually edit domain.xml?
Or do you need to specify that in some esotheric xml file in your webapp?

Per Lindberg
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After some investigation, it turns out that the thread pools that you can define in Glassfish can not be used for HTTP Request servicing. That is done by a hard-coded thread pool, which you can define in the Admin Console under Configuration > HTTP Service > RequestProcessing.

Here it is possible to increase 'Thread Count' from its default value 5 to some higher number (Tomcat has something like 150), or the max number of simultaneous slow requests, such as image upload over a slow net.

But note: each of the three HTTP listeners (8080, 8181, 4848) then will have its own service thread pool with this new size. (Foo!)

Hope this helps someone...

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!