users@glassfish.java.net

Re: simple servlet throttling

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 14 Jul 2008 11:04:39 -0400

Salut,

glassfish_at_javadesktop.org wrote:
> hello,
>
> how can I do things like if I get excessive request to my servlet some sort of limitation mechanism, for example 1 request / second per browser?
>
> I have a flash applet that makes requests to my servlet, and i would like a mechanism so that only requests from the flash applet are answered, (which is a diffucult task) - and if not some sort of throttling.

The easiest way is to write a Filter, and use the Filter to throttle the
request based on some headers your Applet is adding.

An alternative is to take a look at [1]. With [1], you can allocate all
the threads to your Applet application, and all other requests will be
dropped *unless* there is some thread available.

A+

-- Jeanfrancois

[1]
http://weblogs.java.net/blog/jfarcand/archive/2007/06/improving_ajax_1.html




>
> Best.
> -C.B.
> [Message sent by forum member 'segfault2007' (segfault2007)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286411
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>