aspose file tools*
The moose likes Servlets and the fly likes Servlet HTTP client requests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet HTTP client requests" Watch "Servlet HTTP client requests" New topic
Author

Servlet HTTP client requests

Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 79
1) What is the ideal methodology for handling client HTTP requests coming in for a servlet?
- Using Threads?
a) -> Is it not resource-heavy to have a million clients do a million requests at a time?
b) -> Does this only lightly affect the CPU/memory/stability on the server?
c) -> What methodology is used in real-world applications?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
I'm not sure I understand the question. A servlet container does use threads, one per request. I recall reading about tests that showed that a single Tomcat instance using the NIO connector is able to handle thousands of requests per second (actually something between 10000 and 20000, if memory serves). If you need to be able to handle a million simultaneous requests that do a significant amount of work (like serious computation or accessing some other machine like a DB), you'll probably want to put in place a few hundred load-balanced machines.


Ping & DNS - updated with new look and Ping home screen widget
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 79
Hm, sounds interesting. Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    8

In real-world applications the usual thing to do is just to use a servlet container such as Tomcat or Websphere. The situation where you have a million requests at the same time is highly unusual.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet HTTP client requests
 
Similar Threads
help
Servlet Chaining...
Use of getRequestDispactcher()
Forwarding to a different server
Web services security