Sutff about my job and comments about personal activities. Take a look to the first idea.

Wednesday, September 20, 2006

Squid power

I've to say that squid have a powerful regex capability and a flexible delay_pools feature.. and if both are used to decrease the bandwith of audio/video files you should get a performance improvement...

acl regex_progs url_regex -i \.rar$ \.msi$ \.bz2$ \.zip$ \.exe$ \.cab$
acl regex_progs url_regex -i zip\?.*$ exe\?.*$ rar\?.*$
acl regex_audio url_regex -i \.mp3$ \.avi$ \.mpeg$ \.mpg$ \.qt$ \.ram$
acl regex_audio url_regex -i \.mov$ \.flv$ \.wma$ \.asf$ \.wmv$ \.wav$
acl regex_audio url_regex -i mp3\?.*$ mpeg\?.*$ wma\?.*$ asf\?.*$ wmv\?.*$
acl regex_audio url_regex -i videodownload\? get_video\?

delay_pools 3

delay_class 1 2 # pool 1 is a class 2 pool
delay_class 2 2 # pool 2 is a class 2 pool
delay_class 3 2 # pool 3 is a class 2 pool

delay_access 1 allow all !regex_audio !regex_progs
delay_access 1 deny all
delay_access 2 allow all regex_progs
delay_access 2 deny all
delay_access 3 allow all

# Network is 50kbits and a bucket of 300KBytes
delay_parameters 1 -1/-1 6250/300000
# Network is 20kbits and a bucket of 300KBytes
delay_parameters 2 -1/-1 2500/300000
# Network is 2kbits and a bucket of 50KBytes
delay_parameters 3 -1/-1 250/50000

I don't agree with blocking content and I've to give service to 300 users with 1MB
P.D. The regex is just to give an idea of what can be done, beside they can be stripped a bit more.