Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to handle when huge number of requests are there?

Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are 100 requests but, server can handle 10 requests at a time. Then how to handle remaining requests. Every request should be processed. What are the different ways to achieve this?
(Is it handled by application server itself?)

Thanks in Advance.
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typically the web server, but the lines have been blurred over that it is possible for the application to manage too.

If supported, the server would have a configurable number of worker and queue threads. Workers are active threads, serving requests. When these are all taken up, requests are passed to the queue threads to hold the requests until a worker comes available. Once both workers and queue threads are all in use, requests are rejected until the system catches up. It is also possible for requests to leave the queue before getting to a worker if the client closes the connection.
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E.g., in Tomcat this can be configured in the Connector element in conf/server.xml. Have a look at the maxThread, minSpareThreads and maxSpareThreads attributes:
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic