SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks

Wednesday, July 7, 2010

Limiting bandwidth in phproxy

Here is simple tip that can save your server bandwidth from over use of your proxy.  This tips only for webproxy that use PHProxy. Avoid having someone downloading big 700MB movies through your proxy and exausting your bandwidth and forcing your proxy to go down.
In the index.php file search for
‘max_file_size’ => -1,
This means file size is unlimited
Now writing number in this value will limit the max file size that can be downloaded through your proxy site
I will show examples of the values you can put in this line
This value is written in Bytes so 1mb = 1 * 1024 * 1024
1 MB equal to ‘max_file_size’ => 1048576,
5 MB (Recommended) equal to ‘max_file_size’ => 5242880,
10MB (if you have fast server) equal to’max_file_size’ => 10485760,
I recommend any value bellow 5MB would be just fine above 5MB which is more than enough for regular surfing through web pages and also some files like PDF documents and mp3 files. So if your visitor trying to download a file bigger than the limit will be redirected to your proxy home page and see a message like.
Resource Error: An error has occured while trying to browse through the proxy.
The file your are attempting to download is too large.
Maxiumum permissible file size is 5.00 MB
Requested file size is 26.50 MB
After editing this value just save the file and upload it and see bandwidth stats for the next day and you will notice big decrease in bandwidth usage with the ability to get more visitors for the same hosting package.

No comments:

Post a Comment