c - the program performance when using epoll with EPOLLONESHOT in multithread server -
the code easy, because utilize epolloneshot create leader-follower multithread server program.
i run test it, , server echo directly. when qps reaches 150000, 12 worker thread falls d status, server has no memory alloc , disk isn't busy @ all.
the server's qps won't raise if go on add together more test client it, stays @ 150000 qps.
this server does, test client , server on same machine talking through lo(not phyics network card), cpu idle per cpu 60, performance don't increment more, what's bottleneck here ?
epoll_wait(4, {{epollin, {u32=28, u64=28}}}, 1, 1000) = 1 <0.000051> read(28, "hello world\n", 4096) = 12 <0.000005> write(28, "hello world\n", 12) = 12 <0.000015> epoll_ctl(4, epoll_ctl_mod, 28, {epollin|epolloneshot, {u32=28, u64=4656724694760685596}}) = 0 <0.000033> epoll_wait(4, {{epollin, {u32=14, u64=14}}}, 1, 1000) = 1 <0.000038> read(14, "hello world\n", 4096) = 12 <0.000005> write(14, "hello world\n", 12) = 12 <0.000013> epoll_ctl(4, epoll_ctl_mod, 14, {epollin|epolloneshot, {u32=14, u64=4656724694760685582}}) = 0 <0.000040> epoll_wait(4, {{epollin, {u32=15, u64=15}}}, 1, 1000) = 1 <0.000056> read(15, "hello world\n", 4096) = 12 <0.000005> write(15, "hello world\n", 12) = 12 <0.000008> epoll_ctl(4, epoll_ctl_mod, 15, {epollin|epolloneshot, {u32=15, u64=4656724694760685583}}) = 0 <0.000047> epoll_wait(4, {{epollin, {u32=33, u64=33}}}, 1, 1000) = 1 <0.000039> read(33, "hello world\n", 4096) = 12 <0.000004> write(33, "hello world\n", 12) = 12 <0.000019> epoll_ctl(4, epoll_ctl_mod, 33, {epollin|epolloneshot, {u32=33, u64=4656724694760685601}}) = 0 <0.000039> epoll_wait(4, {{epollin, {u32=35, u64=35}}}, 1, 1000) = 1 <0.000042> read(35, "hello world\n", 4096) = 12 <0.000005> write(35, "hello world\n", 12) = 12 <0.000010> epoll_ctl(4, epoll_ctl_mod, 35, {epollin|epolloneshot, {u32=35, u64=4656724694760685603}}) = 0 <0.000042> epoll_wait(4, {{epollin, {u32=8, u64=8}}}, 1, 1000) = 1 <0.000039> read(8, "hello world\n", 4096) = 12 <0.000006> write(8, "hello world\n", 12) = 12 <0.000007> epoll_ctl(4, epoll_ctl_mod, 8, {epollin|epolloneshot, {u32=8, u64=4656724694760685576}}) = 0 <0.000054> epoll_wait(4, {{epollin, {u32=21, u64=21}}}, 1, 1000) = 1 <0.000034> 13283 work 15 0 636m 256m 308 r 19 0.4 4:33.09 server 13288 work 15 0 636m 256m 308 d 19 0.4 4:33.27 server 13286 work 15 0 636m 256m 308 d 17 0.4 4:32.60 server 13287 work 15 0 636m 256m 308 d 17 0.4 4:34.72 server 13280 work 15 0 636m 256m 308 d 15 0.4 4:33.20 server 13281 work 15 0 636m 256m 308 d 15 0.4 7:50.35 server 13282 work 15 0 636m 256m 308 r 15 0.4 4:33.14 server 13290 work 15 0 636m 256m 308 r 15 0.4 4:31.80 server 13279 work 15 0 636m 256m 308 d 13 0.4 4:24.11 server 13285 work 15 0 636m 256m 308 d 13 0.4 4:32.91 server 13289 work 15 0 636m 256m 308 d 13 0.4 4:32.34 server 13284 work 15 0 636m 256m 308 d 12 0.4 4:31.70 server 14042 work 16 0 2380 344 280 s 10 0.0 1:46.98 test_long_conn 6403 work 16 0 3692 580 416 s 10 0.0 0:00.12 grep 13915 work 16 0 2380 344 280 s 8 0.0 1:47.42 test_long_conn 13930 work 16 0 2380 344 280 r 8 0.0 1:49.59 test_long_conn 13945 work 16 0 2380 344 280 s 8 0.0 1:48.38 test_long_conn 13841 work 16 0 2380 344 280 s 6 0.0 1:36.61 test_long_conn 13847 work 16 0 2380 344 280 s 6 0.0 1:49.55 test_long_conn 13848 work 16 0 2380 344 280 s 6 0.0 1:48.75 test_long_conn 13849 work 16 0 2380 344 280 s 6 0.0 1:48.45 test_long_conn 13850 work 16 0 2380 344 280 s 6 0.0 1:48.74 test_long_conn 13913 work 16 0 2380 344 280 r 6 0.0 1:47.50 test_long_conn
c multithreading epoll
No comments:
Post a Comment