redis/tests/unit
sundb e5d8a5eb85
Fix the wrong reisze of querybuf (#9003)
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).
2021-06-15 14:46:19 +03:00
..
moduleapi Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
type Fix XINFO help for unexpected options. (#9075) 2021-06-15 10:01:11 +03:00
acl.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
aofrw.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
auth.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
bitfield.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
bitops.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
dump.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
expire.tcl Fix flaky test case for absolute TTL replication (#9069) 2021-06-13 08:42:20 +03:00
geo.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
hyperloglog.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
info.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
introspection-2.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
introspection.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
keyspace.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
latency-monitor.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
lazyfree.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
limits.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
maxmemory.tcl Fix the wrong reisze of querybuf (#9003) 2021-06-15 14:46:19 +03:00
memefficiency.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
multi.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
networking.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
obuf-limits.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
oom-score-adj.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
other.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
pause.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pendingquerybuf.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
printver.tcl Print version info before running the test 2011-05-20 11:44:54 +02:00
protocol.tcl Add io-thread daily CI tests. (#8232) 2021-01-17 15:48:48 +02:00
pubsub.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
querybuf.tcl Fix the wrong reisze of querybuf (#9003) 2021-06-15 14:46:19 +03:00
quit.tcl Add tests for OK on QUIT 2010-10-15 12:54:53 +02:00
scan.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
scripting.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
shutdown.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
slowlog.tcl slowlog get command supports passing in -1 to get all logs. (#9018) 2021-06-14 16:46:45 +03:00
sort.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
tls.tcl Add support for reading encrypted keyfiles. (#8644) 2021-03-22 13:27:46 +02:00
tracking.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00
wait.tcl Improve test suite to handle external servers better. (#9033) 2021-06-09 15:13:24 +03:00