Forum Moderators: phranque

Message Too Old, No Replies

Test server speeds

how can you slow it down?

         

mack

9:58 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I am currently using apache on my LAN as a test server for development puropses. The only issue I have is that when you are surfing a site on the lan it loads literaly in a fraction of a second. Is there anything I can do to simulate a web environment where the download speeds would be a lot longer?

bcc1234

10:04 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is an apache module that controls bandwidth consumption. I don't remember the name, but try searching for it. It might be what you are looking for.
Another solution would be to configure a traffic shaper on the server.

The latter would be more realistic, since the apache module I mentioned has been designed to limit data-transfer and might not do exactly what you need.

andreasfriedrich

10:24 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The module you are looking for is mod_throttle. But the second method suggested would be better indeed.

Andreas

andreasfriedrich

10:28 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When your server is runnning a kernel 2.4.20+ then you could use Hierarchical Token Buckets to simulate lower speeds. Have a look at the iproute2 project and its tc tool.

Andreas

amznVibe

11:39 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about mod_throttle to limit speed from an internal ip? Would that work?

[snert.com...]

(oh duh, it was mentioned, sorry)

amznVibe

1:52 pm on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Andreas, can you contrast solutions such as mod_throttle to other things I have seen mentioned such as Apache::IPThrottle and Apache::SpeedLimit?

It's related to this thread as I am looking for a way to slow down access to specific file types on one of our servers for ALL visitors (such as windows media wmv, wma files)

andreasfriedrich

2:26 pm on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Isnīt that what consultants are for? And isnīt it what consultants are payed for? ;)

Limiting use of server resources can be achieved at the request level, i.e. allowing only so many requests per IP, allowing only so many requests to certain resources, etc and at the bandwidth level, i.e. once access has been granted for a certain IP/resource you limit the bandwith available for serving this request.

mod_throttle will allow you to do all these things. It is an Apache module that you can control by ordinary Apache directives in your httpd.conf.

Apache::SpeedLimit and Apache::IPThrottle are both Perl modules that are run by mod_perl. SpeedLimit letīs you control the client request rate while IPThrottle lets you limit the bandwith used per IP address. Being Perl modules you can adjust these modules any way you want. But unless you are running mod_perl anyway or are prepared for a steep learning curve you probably should use mod_throttle.

Of course any serious decision on which technology to use would need to involve some prior benchmarking and analysis of your exact needs.

A different approach would be to do the bandwidth management at the OS level*. Let the web server serve web documents and the OS control bandwith. Traffic control via Hierarchical Token Buckets is very powerful and quite hard to configure. Itīs somewhat like mod_rewrite when it comes to rewriting URIs. ;)

Andreas


* Just like it would be a good idea to let the blocking of bad bots to appear at the OS level and not on the application level. Have a look at a link in a post in the 100 range in the almost perfect htaccess thread for a very nice trap setup.