How to limit download speed for a website's files

Created:

2017-01-26 06:53:23 UTC

Modified:

2017-08-08 13:14:50 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to limit download speed for a website's files

Question

How to limit download speed for a website's files?

Answer

  1. Enable ratelimit module at Tools & Settings > Apache Web Server > Apache modules. It is available in apache starting from 2.4 version

  2. Add the following to Domains > example.com > Apache & Nginx Settings > Additional directives for HTTP (Additional directives for HTTPS):

    <IfModule mod_ratelimit.c>
        <Location />
            SetOutputFilter RATE_LIMIT
            SetEnv rate-limit 350
        </Location>
    </IfModule>

    This will limit download speed up to 350 KB/sec for the entire website.

    To limit download speed for the files located in downloads folder:

    <IfModule mod_ratelimit.c>
        <Location /downloads>
            SetOutputFilter RATE_LIMIT
            SetEnv rate-limit 350
        </Location>
    </IfModule>

Note: Nginx should be disabled to make ratelimit module work.

<blockquote class="note"></blockquote>

Have more questions? Submit a request
Please sign in to leave a comment.