Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Managing HTTPRequests

 
Xaviour Simmons
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"vanglorious " please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic