|
About ::
TODO ::
Blog ::
RSS ::
Old blog ::
Projects ::
GIT ::
Gallery ::
Notes
Tue, 31 Jan 2006
Van Jacobson's LCA2006 slides.
Mon, 30 Jan 2006
Van Jacobson's Net Channels.
David's Miller keynote at linux.conf.au. Thu, 26 Jan 2006
Nework asynchronous IO. Wed, 25 Jan 2006
Climbed a lot today. Tue, 24 Jan 2006
"Election Day" performance.
linux.conf.au presentations.
Grange has a birthday! Mon, 23 Jan 2006
Updated W1 project. Sat, 21 Jan 2006
FreeBSD kqueue benchmark. httperf --client=0/1 --server=freebsd --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 1 Total: connections 10000 requests 10000 replies 10000 test-duration 9.667 s Connection rate: 1034.4 conn/s (1.0 ms/conn, <=1 concurrent connections) Connection time [ms]: min 0.3 avg 1.0 max 220.6 median 0.5 stddev 3.8 Connection time [ms]: connect 0.1 Connection length [replies/conn]: 1.000 Request rate: 1034.4 req/s (1.0 ms/req) Request size [B]: 64.0 Reply rate [replies/s]: min 1013.9 avg 1013.9 max 1013.9 stddev 0.0 (1 samples) Reply time [ms]: response 0.4 transfer 0.4 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=10000 5xx=0 CPU time [s]: user 2.30 system 7.06 (user 23.8% system 73.1% total 96.9%) Net I/O: 4235.6 KB/s (34.7*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 Request rate is 1034 requests per second, when Linux in the same hardware (it had only 512 Mb of RAM but it does not matter) and server software (kevent based server used read()/send() syscalls) showed 1700 requests per second. Strange thing is that even Apache on FC4 run faster. Second test. Run several simultaneous connections with different burst size. 1. 10k connections with maximum 1k connections in a burst with 1 second timeout. httperf --timeout=1 --client=0/1 --server=freebsd --port=80 --uri=/ --rate=1000 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 62 Total: connections 10000 requests 10000 replies 9733 test-duration 10.000 s Connection rate: 1000.0 conn/s (1.0 ms/conn, <=64 concurrent connections) Connection time [ms]: min 0.1 avg 1.0 max 15.7 median 0.5 stddev 0.9 Connection time [ms]: connect 0.2 Connection length [replies/conn]: 1.000 Request rate: 1000.0 req/s (1.0 ms/req) Request size [B]: 64.0 Reply rate [replies/s]: min 970.3 avg 970.3 max 970.3 stddev 0.0 (1 samples) Reply time [ms]: response 0.4 transfer 0.4 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=9733 5xx=0 CPU time [s]: user 2.46 system 7.16 (user 24.6% system 71.6% total 96.2%) Net I/O: 3987.1 KB/s (32.7*10^6 bps) Errors: total 267 client-timo 0 socket-timo 0 connrefused 0 connreset 267 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 As we see here, request rate is higher for FreeBSD (1000 vs 910), but number of errors is higher too. 2. 20k connections with maximum 2k connections in a burst with 1 second timeout. httperf --timeout=1 --client=0/1 --server=freebsd --port=80 --uri=/ --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=20000 --num-calls=1 Maximum connect burst length: 4 Total: connections 20000 requests 20000 replies 14371 test-duration 10.000 s Connection rate: 2000.0 conn/s (0.5 ms/conn, <=6 concurrent connections) Connection time [ms]: min 0.2 avg 1.0 max 2.5 median 0.5 stddev 0.1 Connection time [ms]: connect 0.2 Connection length [replies/conn]: 1.000 Request rate: 2000.0 req/s (0.5 ms/req) Request size [B]: 64.0 Reply rate [replies/s]: min 1534.9 avg 1534.9 max 1534.9 stddev 0.0 (1 samples) Reply time [ms]: response 0.4 transfer 0.4 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=14371 5xx=0 CPU time [s]: user 2.32 system 7.68 (user 23.2% system 76.8% total 100.0%) Net I/O: 5919.8 KB/s (48.5*10^6 bps) Errors: total 5629 client-timo 0 socket-timo 0 connrefused 0 connreset 5629 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 Very good request rate for FreeBSD, but very big number of "connection reset" errors. 3. 30k connections with maximum 3k connections in a burst with 1 second timeout. httperf --timeout=1 --client=0/1 --server=freebsd --port=80 --uri=/ --rate=3000 --send-buffer=4096 --recv-buffer=16384 --num-conns=30000 --num-calls=1 Maximum connect burst length: 285 Total: connections 30000 requests 29964 replies 18608 test-duration 10.000 s Connection rate: 2999.9 conn/s (0.3 ms/conn, <=329 concurrent connections) Connection time [ms]: min 0.4 avg 1.5 max 105.2 median 1.5 stddev 0.9 Connection time [ms]: connect 0.4 Connection length [replies/conn]: 1.000 Request rate: 2996.3 req/s (0.3 ms/req) Request size [B]: 64.0 Reply rate [replies/s]: min 1709.9 avg 1860.6 max 2011.3 stddev 213.2 (2 samples) Reply time [ms]: response 0.6 transfer 0.6 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=18608 5xx=0 CPU time [s]: user 1.53 system 8.38 (user 15.3% system 83.8% total 99.1%) Net I/O: 7690.1 KB/s (63.0*10^6 bps) Errors: total 11392 client-timo 40 socket-timo 0 connrefused 0 connreset 11352 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 Excellent request rate for FreeBSD (3000 vs. 2500 in Linux with sendfile()), but enormous number of errors, and only 62% of connection requests were successfully finished. Conclusion. After various sysctls have been changed ( sysctl -a output is available
here) things
become slightly better (btw, default FreeBSD installation does not allow
such tests at all due to default network parameters), but number of "connection reset"
errors is still very high.FreeBSD drops too many connections due to either misconfiguration or lack of resources. According to FreeBSD and Linux comparison, in Linux number of connection errors is much smaller than in FreeBSD with comparable or bigger requests rate. Fri, 20 Jan 2006
Created web pages for receiving zero-copy and kevent subsystems.
Weather in Moscow. Thu, 19 Jan 2006
Kevent benchmarking. Step 5. New record!
[s0mbre@uganda httperf-0.8]$ ./httperf --server pcix --num-conns 30000 --rate 3000 --timeout 1
httperf --timeout=1 --client=0/1 --server=pcix --port=80 --uri=/ --rate=3000 --send-buffer=4096 --recv-buffer=16384 --num-conns=30000 --num-calls=1
Maximum connect burst length: 101
Total: connections 29197 requests 27739 replies 27101 test-duration 11.000 s
Connection rate: 2654.4 conn/s (0.4 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 5.1 avg 62.9 max 989.7 median 44.5 stddev 91.4
Connection time [ms]: connect 0.4
Connection length [replies/conn]: 1.000
Request rate: 2521.8 req/s (0.4 ms/req)
Request size [B]: 55.0
Reply rate [replies/s]: min 2539.9 avg 2701.8 max 2863.7 stddev 228.9 (2 samples)
Reply time [ms]: response 62.5 transfer 0.0
Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0)
Reply status: 1xx=0 2xx=0 3xx=0 4xx=27101 5xx=0
CPU time [s]: user 0.22 system 10.32 (user 2.0% system 93.8% total 95.8%)
Net I/O: 10070.1 KB/s (82.5*10^6 bps)
Errors: total 2899 client-timo 2096 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 803 addrunavail 0 ftab-full 0 other 0Both epoll and kevent_poll shows about 1600-1700 requests per second in this setup. As usual, patch is available in archive.
Did you hear that russians can only drink vodka, graze bears and play balalaika. Wed, 18 Jan 2006
Kevent benchmarking. Step 4.
$ ./httperf --server pcix --num-conns 30000 --rate 3000 --timeout 1
kevent_poll : Request rate: 1718.8 req/s (0.6 ms/req)
kevent_poll (Jenkins hash): Request rate: 1749.9 req/s (0.6 ms/req)
epoll : Request rate: 1746.8 req/s (0.6 ms/req)
Subsequent run of any server obviously always shows temporary performance degradation,
which order depends on time spent after previous run.If we get into account that kevent_poll transfers to userspace 3.3 times more information (extended flags, user's id, additional 64 bits of data, which can be used as hints and so on), then kevent_poll is not so bad. Tue, 17 Jan 2006
Kevent benchmarking. Step 3. [s0mbre@uganda httperf-0.8]$ ./httperf --server pcix --num-conns 10000 --rate 1000 --timeout 1 httperf --timeout=1 --client=0/1 --server=pcix --port=80 --uri=/ --rate=1000 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 30 Total: connections 10000 requests 9947 replies 9816 test-duration 11.000 s Connection rate: 909.1 conn/s (1.1 ms/conn, <=164 concurrent connections) Connection time [ms]: min 0.3 avg 104.1 max 139.6 median 129.5 stddev 38.6 Connection time [ms]: connect 0.1 Connection length [replies/conn]: 1.000 Request rate: 904.3 req/s (1.1 ms/req) Request size [B]: 55.0 Reply rate [replies/s]: min 966.8 avg 981.6 max 996.5 stddev 21.0 (2 samples) Reply time [ms]: response 103.9 transfer 0.0 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=9816 5xx=0 CPU time [s]: user 0.35 system 10.30 (user 3.2% system 93.6% total 96.8%) Net I/O: 3646.9 KB/s (29.9*10^6 bps) Errors: total 184 client-timo 184 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 Which means almost full absence of latency in accept() and corresponding client processing compared with step 2 results and Apache2. To make things worse I need to admit, that it is only first test that runs at such high request rate, subsequent rates are lower, down to 500 req/s, but main socket recreation (and new kevent_user strucutre which holds kevent's hash table) returns things to more than 900 req/s again. I suspect it is a problem with hash unfairness and socket's lifetime, since socket can live even after has been closed by user. Patch and new evserver are available in archive. Mon, 16 Jan 2006
Updated kevent patch.
Kevent benchmarking. Step 1. httperf --client=0/1 --server=pcix --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 1 Total: connections 10000 requests 10000 replies 10000 test-duration 5.684 s Connection rate: 1759.4 conn/s (0.6 ms/conn, <=1 concurrent connections) Connection time [ms]: min 0.2 avg 0.6 max 204.5 median 0.5 stddev 3.5 Connection time [ms]: connect 0.1 Connection length [replies/conn]: 1.000 Request rate: 1759.4 req/s (0.6 ms/req) Request size [B]: 55.0 Reply rate [replies/s]: min 1810.8 avg 1810.8 max 1810.8 stddev 0.0 (1 samples) Reply time [ms]: response 0.2 transfer 0.2 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=10000 5xx=0 CPU time [s]: user 1.46 system 4.23 (user 25.6% system 74.4% total 100.0%) Net I/O: 7188.6 KB/s (58.9*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 Using sendfile():
Connection rate: 2586.5 conn/s (0.4 ms/conn, <=1 concurrent connections)The same index.html on Apache/2.0.54 from FC4 (default config) on P4 3.00GHz, 512 Mb RAM, HT enabled, 1Gb network. [s0mbre@uganda httperf-0.8]$ ./httperf --server kano --num-conns 10000 httperf --client=0/1 --server=kano --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 1 Total: connections 10000 requests 10000 replies 10000 test-duration 7.947 s Connection rate: 1258.4 conn/s (0.8 ms/conn, <=1 concurrent connections) Connection time [ms]: min 0.2 avg 0.8 max 561.2 median 0.5 stddev 5.6 Connection time [ms]: connect 0.2 Connection length [replies/conn]: 1.000 Request rate: 1258.4 req/s (0.8 ms/req) Request size [B]: 55.0 Reply rate [replies/s]: min 1348.2 avg 1348.2 max 1348.2 stddev 0.0 (1 samples) Reply time [ms]: response 0.6 transfer 0.0 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=10000 5xx=0 CPU time [s]: user 1.92 system 5.90 (user 24.2% system 74.3% total 98.4%) Net I/O: 5141.7 KB/s (42.1*10^6 bps) Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
Kevent benchmarking. Step 2. [s0mbre@uganda httperf-0.8]$ ./httperf --server pcix --num-conns 10000 --rate 1000 --timeout 1 httperf --timeout=1 --client=0/1 --server=pcix --port=80 --uri=/ --rate=1000 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 207 Total: connections 10000 requests 8742 replies 8519 test-duration 11.001 s Connection rate: 909.0 conn/s (1.1 ms/conn, <=453 concurrent connections) Connection time [ms]: min 96.8 avg 149.0 max 854.3 median 141.5 stddev 36.5 Connection time [ms]: connect 0.2 Connection length [replies/conn]: 1.000 Request rate: 794.7 req/s (1.3 ms/req) Request size [B]: 55.0 Reply rate [replies/s]: min 812.0 avg 851.8 max 891.6 stddev 56.3 (2 samples) Reply time [ms]: response 148.8 transfer 0.0 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=8519 5xx=0 CPU time [s]: user 0.19 system 10.40 (user 1.7% system 94.5% total 96.3%) Net I/O: 3165.3 KB/s (25.9*10^6 bps) Errors: total 1481 client-timo 1481 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0 The same index.html on Apache/2.0.54 from FC4 (default config) on P4 3.00GHz, 512 Mb RAM, HT enabled, 1Gb network. [s0mbre@uganda httperf-0.8]$ ./httperf --server kano --num-conns 10000 --rate 1000 --timeout 1 httperf --timeout=1 --client=0/1 --server=kano --port=80 --uri=/ --rate=1000 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=1 Maximum connect burst length: 21 Total: connections 10000 requests 4731 replies 4731 test-duration 10.976 s Connection rate: 911.1 conn/s (1.1 ms/conn, <=813 concurrent connections) Connection time [ms]: min 0.2 avg 1.2 max 20.9 median 0.5 stddev 1.5 Connection time [ms]: connect 0.1 Connection length [replies/conn]: 1.000 Request rate: 431.0 req/s (2.3 ms/req) Request size [B]: 55.0 Reply rate [replies/s]: min 401.6 avg 472.9 max 544.3 stddev 100.9 (2 samples) Reply time [ms]: response 1.1 transfer 0.0 Reply size [B]: header 198.0 content 3931.0 footer 0.0 (total 4129.0) Reply status: 1xx=0 2xx=0 3xx=0 4xx=4731 5xx=0 CPU time [s]: user 0.20 system 10.55 (user 1.9% system 96.1% total 98.0%) Net I/O: 1761.2 KB/s (14.4*10^6 bps) Errors: total 5269 client-timo 5269 socket-timo 0 connrefused 0 connreset 0 Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
Climbed today with Grange.
Grange started w1 project. gpioow1 at gpio1 pins 21: DQ[21] open-drain pull-up onewire1 at gpioow1 onewire1: found ROM 0xf00008005343fb10It took him two years after we bought first couple of ds18b20 thermal sensors to start this project :) Sun, 15 Jan 2006
Kevent hacking. Sat, 14 Jan 2006
Kevent hacking. Fri, 13 Jan 2006
Kevent hacking.
Climbed a little today. Thu, 12 Jan 2006
Kevent hacking.
When kevent is queued into storage, it will live there until removed by kevent_dequeue(). When some activity is noticed in given storage, it scans it's kevent_storage->list for kevents which match activity event. If kevents are found and they are not already in the kevent_user->ready_list, they will be added there at the end. Added ->poll() method which is quite trivial. Patch is available in archive. Also thinking about socket and generic poll()/select() notifications. Wed, 11 Jan 2006
Kevent hacking. Notifications of inode events. 1136980589.00958284: Wait: num=1, ctl->num=1: diff=1857538 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00959683: Wait: num=1, ctl->num=1: diff=1351 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00961091: Wait: num=1, ctl->num=1: diff=1359 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00962455: Wait: num=1, ctl->num=1: diff=1313 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00963818: Wait: num=1, ctl->num=1: diff=1312 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00965233: Wait: num=1, ctl->num=1: diff=1363 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00966606: Wait: num=1, ctl->num=1: diff=1322 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00967983: Wait: num=1, ctl->num=1: diff=1328 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00969384: Wait: num=1, ctl->num=1: diff=1355 usec. 00000000: 00000004.00000000 - 00000000.00000000 1136980589.00970780: Wait: num=1, ctl->num=1: diff=1344 usec. 00000000: 00000004.00000000 - 00000000.00000000evtest.c was asked to wait for KEVENT_INODE_CREATE event which is emitted each time new file is created. It is quite different compared with inotify: it does not send filename as parameter, it does not allocate new event of requested type when inode is changed, but scans for events which were requested by user before, so if kevent was not marked as one-shot it will be requeued into list of interests for given storage (inode, socket, timer, anything) only when user has read either requested number of kevents or timeout elapsed, so it is possible to lose events and when it is requeued, i.e. it is not one-shot event, it must check if the same condition occured while request was in user's ready queue and if so, it must signal about this immediately. New version of kevent subsytem patch is available in archive. Tue, 10 Jan 2006
Kevent hacking. Sun, 08 Jan 2006
Japanese food day. Sat, 07 Jan 2006
Kevent hacking.
Updated CARP module. Fri, 06 Jan 2006
Kevent hacking. kevent_enqueue: k=de679400. __kqueue_enqueue_kevent: into READY or ORIGIN k=de679400, q=dd70f9e4. kevent_storage_enqueue: into storage k=de679400, st=dd70f9d8. kevent_user_wait: requested: ready_num=10, timeout=1000. kevent_timer_callback: k=de679400. __kqueue_dequeue_kevent: from READY or ORIGIN k=de679400, q=dd70f9e4. __kqueue_enqueue_kevent: into READY or ORIGIN k=de679400, q=de679514. __kqueue_dequeue_one: from READY or ORIGIN k=de679400, q=de679514. kqueue_dequeue_ready: dequeued from READY queue k=de679400. __kqueue_dequeue_one: from READY or ORIGIN k=00000000, q=de679514. kqueue_dequeue_ready: dequeued from READY queue k=00000000. __kqueue_dequeue_one: from READY or ORIGIN k=00000000, q=de679514. kqueue_dequeue_ready: dequeued from READY queue k=00000000.It is not very informative, but it looks like timer events are somehow managed by new kevent subsystem. It's initial draft has horrible userspace interface, but main logic has been already implemented. Next couple of days I probably will not work on this problem, so it will be postponed until Monday. Initial patch is available in archive. It is quite well documented, which is strange for me... Thu, 05 Jan 2006
FreeBSD's kqueue. Wed, 04 Jan 2006
Still in a hacking land. Tue, 03 Jan 2006
Day of interesting hacking and movie watching. Mon, 02 Jan 2006
Happy New Year! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||