Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The two most common ways of handling this are to turn away requests when the server is too busy, or handle each request slower.</p> <p>Turning away requests is easy; just run a fixed number of instances. The OS may or may not queue up a few connection requests, but in general the users will simply fail to connect. A more graceful way of doing it is to have the service return an error code indicating the client should try again later.</p> <p>Handling requests slower is a bit more work, because it requires separating the servlet handling the requests from the class doing the work in a different thread. You can have a larger number of servlets than worker bees. When a request comes in it accepts it, waits for a worker bee, grabs it and uses it, frees it, then returns the results.</p> <p>The two can communicate through one of the classes in <a href="http://java.sun.com/developer/technicalArticles/J2SE/concurrency/" rel="nofollow">java.util.concurrent</a>, like <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/LinkedBlockingQueue.html" rel="nofollow">LinkedBlockingQueue</a> or <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ThreadPoolExecutor.html" rel="nofollow">ThreadPoolExecutor</a>. If you want to get really fancy, you can use something like a <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/PriorityBlockingQueue.html" rel="nofollow">PriorityBlockingQueue</a> to serve some customers before others.</p> <p>Me, I would throw more hardware at it like Anon said ;)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload