]> git.kaiwu.me - nginx.git/commitdiff
Fixed throughput problems with large limit_rate.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 26 Dec 2011 10:49:57 +0000 (10:49 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 26 Dec 2011 10:49:57 +0000 (10:49 +0000)
Previous attempt to fix this was in r1658 (0.6.18), though that one wasn't
enough (it was a noop).

src/http/ngx_http_write_filter_module.c

index 46351349cf5c6a527165b3bd01c87b30c7a5ce40..f5dc6c1960fc5910982e1940cbb4e504e9a98312 100644 (file)
@@ -262,7 +262,7 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
             }
         }
 
-        delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate + 1);
+        delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate);
 
         if (delay > 0) {
             c->write->delayed = 1;