Welcome! Log In Create A New Profile

Advanced

Re: limit rate и высокие скорости

Maxim Dounin
June 22, 2020 06:28AM
Hello!

On Sun, Jun 21, 2020 at 05:53:57PM -0400, edo1 wrote:

> есть такой конфиг:
> server {
> listen 19999 default_server reuseport;# sndbuf=4m;
> location ~ ^/speedtest-limit-([0-9]+[km]?)/([^/]*)$ {
> limit_rate $1;
> limit_rate_after 2m;
> alias /var/www/speedtest/$2;
> }
> }
>
> проверяю скорость скачивания без лимита, вполне приличная:
> $ curl -o /dev/null 127.0.0.1:19999/speedtest-limit-0/1000mb
> % Total % Received % Xferd Average Speed Time Time Time
> Current
> Dload Upload Total Spent Left
> Speed
> 100 1000M 100 1000M 0 0 2375M 0 --:--:-- --:--:-- --:--:--
> 2375M
>
> с относительно небольшим лимитом всё хорошо:
> $ curl -o /dev/null 127.0.0.1:19999/speedtest-limit-1m/100mb
> % Total % Received % Xferd Average Speed Time Time Time
> Current
> Dload Upload Total Spent Left
> Speed
> 100 100M 100 100M 0 0 1044k 0 0:01:38 0:01:38 --:--:--
> 1008k
>
> а вот с лимитом повыше ерунда выходит:
> $ curl -o /dev/null 127.0.0.1:19999/speedtest-limit-100m/1000mb
> % Total % Received % Xferd Average Speed Time Time Time
> Current
> Dload Upload Total Spent Left
> Speed
> 100 1000M 100 1000M 0 0 42.9M 0 0:00:23 0:00:23 --:--:--
> 42.6M
>
>
> что можно подкрутить?

Подкрутить можно размеры буферов и/или включить sendfile,
подробнее тут:

https://trac.nginx.org/nginx/ticket/1678#comment:1

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Re: limit rate и высокие скорости

Maxim Dounin June 22, 2020 06:28AM

Re: limit rate и высокие скорости

edo1 June 25, 2020 03:52PM

Re: limit rate и высокие скорости

Maxim Dounin June 26, 2020 12:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 55
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready