Grace delay feature added

`proxy -g8000,3,10`

First parameter is average read size we want to keep, second parameter is
minimal number of packets in the same direction to apply algorythm,
last value is delay added after polling and prior to reading data.
An example above adds 10 millisecond delay before reading data if average
polling size is below 8000 bytes and 3 read operations are made in the same
direction. It's specially usefule with splice. `logdump 1 1` is useful
to see how grace delays work, choose delay value to avoid filling the read
pipe/buffer (typically 64K) but keep the request sizes close to chosen average
on large file upload/download.
This commit is contained in:
Vladimir Dubrovin committed 2022-05-19 18:51:02 +03:00
1 parent 8a8622b30f
commit 55d1bbe155
8 files changed
+49 -2

No files matched your search

+2
View File
@@ -437,6 +437,7 @@ struct srvparam {
int noforce;
int anonymous;
int clisockopts, srvsockopts, lissockopts, cbcsockopts, cbssockopts;
int gracetraf, gracenum, gracedelay;
#ifdef WITHSPLICE
int usesplice;
#endif
@@ -576,6 +577,7 @@ struct extparam {
demon, maxchild, needreload, timetoexit, version, noforce, bandlimver, parentretries;
int authcachetype, authcachetime;
int filtermaxsize;
int gracetraf, gracenum, gracedelay;
unsigned char *logname, **archiver;
ROTATION logtype, countertype;
char * counterfile;