Open fairyqb opened 2 years ago
benchmark code: redis_perf.lua.txt
result:
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
TCP_NODELAY TCP_QUICKACK TCP_CORK TCP_SACK TCP_MIN_SND_MSS Try the above parameters, no effect
Packet capture data round trip, most of the data is 0.2ms, where does 0.8ms occupy in 1ms
benchmark code: redis_perf.lua.txt
result:
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