lua-resty-redis icon indicating copy to clipboard operation
lua-resty-redis copied to clipboard

The performance of redis pipeline mode is unstable

Open fairyqb opened this issue 3 years ago • 3 comments
trafficstars

benchmark code: redis_perf.lua.txt

result: 2d4a8ce7d3c49507f74e9d7feccb726

setsockopt(5, SOL_TCP, TCP_NODELAY, [1], 4) = 0 sendto(5, "2\r\n$4\r\nincr\r\n$3\r\ncat\r\n2\r\n$4\r\ni"..., 184, 0, NULL, 0) = 184 epoll_wait(3, [{EPOLLIN|EPOLLOUT, {u32=15020632, u64=15020632}}], 512, 60000) = 1 recvfrom(5, ":4459457\r\n:4459458\r\n:4459459\r\n:4"..., 4096, 0, NULL, NULL) = 80 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff1ca1ac000 write(1, "result:4459457\n", 15) = 15 write(1, "end\n", 4) = 4 close(5) = 0 unlink("/tmp/resty_MsvuPNYENK/logs/nginx.pid") = 0 munmap(0x7ff1ca15e000, 262144) = 0

@agentzh @thibaultcha @spacewander

fairyqb avatar Sep 08 '22 14:09 fairyqb

TCP_NODELAY TCP_QUICKACK TCP_CORK TCP_SACK TCP_MIN_SND_MSS Try the above parameters, no effect

fairyqb avatar Sep 08 '22 23:09 fairyqb

image

Packet capture data round trip, most of the data is 0.2ms, where does 0.8ms occupy in 1ms

fairyqb avatar Sep 09 '22 00:09 fairyqb

image

image

image

fairyqb avatar Sep 09 '22 09:09 fairyqb