summaryrefslogtreecommitdiff
path: root/tests/unit/querybuf.tcl
Commit message (Collapse)AuthorAgeFilesLines
* Ignore resize threshold on idle qbuf resizing (#9322)yoav-steinberg2021-08-061-13/+31
| | | | Also update qbuf tests to verify both idle and peak based resizing logic. And delete unused function: getClientsMaxBuffers
* Fix querybuf test failure (#9091)sundb2021-06-161-1/+1
| | | | | | Fix test failure which introduced by #9003. The following case will occur when querybuf expansion will allocate memory equal to (16*1024)k. 1) make use ```CFLAGS=-DNO_MALLOC_USABLE_SIZE```. 2) ```malloc``` will not allocate more under ```alpine```.
* Fix the wrong reisze of querybuf (#9003)sundb2021-06-151-0/+48
The initialize memory of `querybuf` is `PROTO_IOBUF_LEN(1024*16) * 2` (due to sdsMakeRoomFor being greedy), under `jemalloc`, the allocated memory will be 40k. This will most likely result in the `querybuf` being resized when call `clientsCronResizeQueryBuffer` unless the client requests it fast enough. Note that this bug existed even before #7875, since the condition for resizing includes the sds headers (32k+6). ## Changes 1. Use non-greedy sdsMakeRoomFor when allocating the initial query buffer (of 16k). 1. Also use non-greedy allocation when working with BIG_ARG (we won't use that extra space anyway) 2. in case we did use a greedy allocation, read as much as we can into the buffer we got (including internal frag), to reduce system calls. 3. introduce a dedicated constant for the shrinking (same value as before) 3. Add test for querybuf. 4. improve a maxmemory test by ignoring the effect of replica query buffers (can accumulate many ACKs on slow env) 5. improve a maxmemory by disabling slowlog (it will cause slight memory growth on slow env).