August 2017
Intermediate to advanced
278 pages
8h 53m
English
The limit_rate directive sets the rate at which each connection can download. This rate is set in bytes per second, not bits per second. Most internet connections are normally represented in bits per second; so, to convert, you will need to divide by eight to set. Our recipe has a limit of 5 Megabytes per second (MBps), so when it comes to bandwidth in bits, we'll see 40 Megabits per Second (Mbps).
We can test this limit using wget:
wget http://limitbw.nginxcookbook.com/1000meg.test
With our limit in place, the result is as follows:

While the rate will fluctuate slightly, we can see that the overall average was 4.94 MBps, ...
Read now
Unlock full access