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 3310824
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:48:17+00:00 2026-05-17T21:48:17+00:00

My webservers use the usual Java I/O with thread per connection mechanism. Nowadays, they

  • 0

My webservers use the usual Java I/O with thread per connection mechanism. Nowadays, they are getting on their knees with increased user (long polling connection). However, the connections are mostly idle. While this can be solved by adding more webservers, I have been trying to do some research on the NIO implementation.

I got a mixed impression about it. I have read about benchmarks where regular I/O with the new NPTL library in Linux outperforms NIO.

What is the real life experience of configuring and using the latest NPTL for Linux with Java I/O? Is there any increased performance?

And on a larger scope question:

What is the maximum number of I/O and blocking threads (that we configure in the Tomcat thread pool) in a standard server class machine (Dell with a quad-core processor) we expect to perform normally (with Linux NPTL library?). What’s the impact if the threadpool gets really big, say more than 1000 threads?

Any references and pointers will be very much appreciated.

  • 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-17T21:48:18+00:00Added an answer on May 17, 2026 at 9:48 pm

    Provocative blog posting, “Avoid NIO, get better throughput.” Paul Tyma’s(2008) blog claims ~5000 threads without any trouble; I’ve heard folks claim more:

    1. With NPTL on, Sun and Blackwidow JVM 1.4.2 scaled easily to 5000+
      threads. Blocking model was
      consistently 25-35% faster than using
      NIO selectors. Lot of techniques
      suggested by EmberIO folks were
      employed – using multiple selectors,
      doing multiple (2) reads if the first
      read returned EAGAIN equivalent in
      Java. Yet we couldn’t beat the plain
      thread per connection model with Linux
      NPTL.

    I think the key here is to measure the overhead and performance, and make the move to non-blocking I/O only when you know you need to and can demonstrate an improvement. The additional effort to write and maintain non-blocking code should be factored in to your decision. My take is, if your application can be cleanly expressed using synchronous/blocking I/O, DO THAT. If your application is amenable to non-blocking I/O and you won’t just be re-inventing blocking I/O badly in application-space, CONSIDER moving to nio based on measured performance needs. I’m amazed when I poke around the google results for this how few of the resources actually cite any (recent) numbers!

    Also, see Paul Tyma’s presentation slides: The old way is new again. Based on his work at Google, concrete numbers suggest that synchronous threaded I/O is quite scalable on Linux, and consider “NIO is faster” a myth that was true for awhile, but no longer. Some good additional commentary here on Comet Daily. He cites the following (anecdotal, still no solid link to benchmarks, etc…) result on NPTL:

    In tests, NPTL succeeded in starting
    100,000 threads on a IA-32 in two
    seconds. In comparison, this test
    under a kernel without NPTL would have
    taken around 15 minutes

    If you really are running into scalability problems, you may want to tune the thread stack size using XX:ThreadStackSize. Since you mention Tomcat see here.

    Finally, if you’re bound and determined to use non-blocking I/O, make every effort to build on an existing framework by people who know what they’re doing. I’ve wasted far too much of my own time trying to get an intricate non-blocking I/O solution right (for the wrong reasons).

    See also related on SO.

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

Sidebar

Related Questions

I am very new to creating webservers - and I have had several goes
We've been running eAccelerator on each of 3 webservers and are looking to move
I develop a web application that needs to be load balanced across 4 webservers.
If webserver can send gzip response, why can't browser sent gzip request?
I got a webserver with a running application. There's a webpage with a form:
I have a Linux web server farm with about 5 web servers, web traffic
I have an embedded webserver that has a total of 2 Megs of space
We've got a webserver running IIS. We'd like to run maybe a shared blog
I have a webserver running on my Windows XP computer. I have set the
In my Apache webserver I put this: <Directory /var/www/MYDOMAIN.com/htdocs> SetHandler mod_python PythonHandler mod_python.publisher PythonDebug

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.