You suggest "system using a Filter that monitors all of the data".
Are there any hooks in Tomcat that allow you to make this filter?  Would
I need to modify Tomcat source to do this?  (I hope not)

Also, I'm still hoping someone has already done something similar.  Any
ideas on similar projects?

Thanks, -Peter



-----Original Message-----
From: Will Hartung [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 12, 2005 6:55 PM
To: Tomcat Users List
Subject: Re: Looking for way to constrain bandwidth from a tomcat
servlet

> From: "Kellner, Peter" <[EMAIL PROTECTED]>
> Sent: Thursday, May 12, 2005 6:14 PM


> I have a particular web page that hits a servlet and I'm finding that
> certain users suck out huge bandwidth.  Does anyone know of any
products
> or open source projects that work with tomcat that will allow me to
> "throttle" bandwidth to certain users based on some criteria?  (like
> total bandwidth already consumed by that user).

Bandwidth is hard to manage at the application level, particularly with
proxies and what not potentially in the way, but you can measure actual
data
sent for a user.

You can create a system using a Filter that monitors all of the data
going
out of tomcat (and technically how long it takes, thus measuring actual
bandwidth).

You would hijack the stream used in the original request so you can
monitor
to the traffic.

You can then move the data from the hijacked stream to the requests
stream
as fast, or as slow, as you like (perhaps by throwing some
Thread.sleep()
calls in the main "copy the stream" loop).

But be aware that while Thread.sleep takes milliseconds as a parameter,
it
doesn't mean it actually supports full millisecond granularity (it may,
but
you should test it and make sure), but it may only go as low as 10, or
even
100 milliseconds.

You could also simply use the filter to "ban" the user from a specific
hungry resource if you like.

I'm sure there are other things like this, perhaps something for Apache.

Regards,

Will Hartung
([EMAIL PROTECTED])


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to