File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Managing HTTPRequests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Managing HTTPRequests" Watch "Managing HTTPRequests" New topic

Managing HTTPRequests

Xaviour Simmons

Joined: Nov 03, 2008
Posts: 2
Hi guys,

wondered if I could have your input on this.

I'm going to be building a simple financial calculator as a web-app. The underlying calculator logic takes 30ms to churn out its answer. My basic idea for the architecture was

JSP (where users input values to calculator) -> Servlet (grabs the request paramaters, does the calculation, places the answer on the request and does a forward to another JSP which displays the answer)

I was wondering how I can tweak this to manage high request rates - i.e. if a lot of requests are coming in, I want some kind of clever queuing mechanism that, say, will tell users to "Wait a while and try again" or something similar?

Is there a way to put together a framework like this using Apache or Tomcat?
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
Do you what is the response time ? and how many users you need to handle simultanously are you using any kind of frame works like struts or anything ?
Xaviour Simmons

Joined: Nov 03, 2008
Posts: 2
Hi thanks for your response mate.

Other than the fact it takes 30ms to process a calculation, I don't really have any other numbers at hand unfortunately.

I do know that we want to guard against the same client hitting the website with too many multiple requests (something which can be programmatically achieved with a command line tool like curl).

We don't have a particular framework like Struts in mind, only because the site is otherwise very simple in its construction.

What about using Filters to intercept the requests and maintain a map of client IPs to the number of requests they have already sent? That way if a particular IP has already sent, say, X requests, we can deny processing any further ones until the current ones have been dealt with.
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

"vanglorious " please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.

|Asking Good Questions|
I agree. Here's the link:
subject: Managing HTTPRequests
jQuery in Action, 3rd edition