00:00:01  * ircretaryquit (Remote host closed the connection)
00:00:08  * ircretaryjoined
00:00:27  * stagasjoined
00:06:51  * jmar777joined
00:07:08  <piscisaureus_>bnoordhuis: no you didn't miss a company meeting. Besides, don't worry, you are never there anyway :-p
00:07:31  <piscisaureus_>ircretary: tell bnoordhuis that ^
00:07:32  <ircretary>piscisaureus_: I'll be sure to tell bnoordhuis
00:13:09  <isaacs>piscisaureus_: oh, that's odd..
00:13:17  <isaacs>(re: empty filename)
00:13:27  <piscisaureus_>isaacs: no it isn't
00:13:59  <piscisaureus_>isaacs: if you pass '' then sanitize returns ''
00:14:06  <piscisaureus_>isaacs: but you are doing checks like:
00:14:10  <isaacs>oh, hahhah
00:14:11  <isaacs>righ
00:14:20  <isaacs>because it is doing truthiness
00:14:24  <piscisaureus_>yep
00:15:11  <isaacs>so i need to check if path === false
00:15:21  <piscisaureus_>I suppose
00:17:51  <isaacs>or separate nullBytesCheck and makeLong
00:17:56  <piscisaureus_>yeah
00:18:05  <piscisaureus_>I don't really like how ben organized it :-)
00:18:16  <piscisaureus_>but I didn't care enough to make a point of it
00:18:42  <piscisaureus_>isaacs: I think it may actually be more readable if you do
00:19:08  <piscisaureus_>function stat(path, cb) {
00:19:09  <piscisaureus_> if (!verify(path, cb)) return;
00:19:09  <piscisaureus_> path = _makeLong(path);
00:19:09  <piscisaureus_>}
00:19:50  <isaacs>hm. yeah, this is a bit wonky
00:20:02  <isaacs>just pushed a patch to make it work
00:21:04  <isaacs>er, no i didn't.
00:21:12  <isaacs>gci -m !== gci -am
00:21:30  <isaacs>there we go
00:25:21  * ircretaryquit (Remote host closed the connection)
00:25:28  * ircretaryjoined
00:29:17  <piscisaureus_>isaacs: ok, lgtm
00:29:28  <isaacs>piscisaureus_: i agree about the readability, but meh
00:29:29  <piscisaureus_>isaacs: I don't really like the look of it tho :-)
00:29:36  <isaacs>yeah
00:29:43  <isaacs>i think maybe a verify() function would just be better.
00:31:31  * ArmyOfBrucequit (Excess Flood)
00:32:02  * ArmyOfBrucejoined
00:32:09  * ArmyOfBrucequit (Excess Flood)
00:32:36  * ArmyOfBrucejoined
00:53:22  <isaacs>piscisaureus_: https://github.com/isaacs/node/compare/fs-throw-on-null-bytes
01:06:17  <piscisaureus_>isaacs: MUCH better
01:06:19  <piscisaureus_>isaacs: lgtm
01:06:50  <MI6>joyent/node: isaacs master * 0e95ea4 : lint introduced in 5b65638. (+1 more commits) - http://git.io/yrUQrw
01:09:49  * jmar777quit (Remote host closed the connection)
01:13:02  * piscisaureus_quit (Quit: ~ Trillian Astra - www.trillian.im ~)
01:20:42  <MI6>joyent/node: Bert Belder master * 3c293ba : http: protect against response splitting attacks - http://git.io/ARhRbg
01:20:46  <isaacs>piscisaureus: Thanks ^
01:22:37  * CoverSlide|Workquit (Quit: Lost terminal)
01:27:00  * lohkeyquit (Read error: Connection reset by peer)
01:27:50  * lohkeyjoined
01:34:48  * loladirojoined
01:37:24  * joshthecoderquit (Quit: Leaving...)
01:47:10  * tommybergeronjoined
01:49:00  * piscisaureus_joined
01:51:04  * tomshredsquit (Ping timeout: 244 seconds)
02:01:57  * jmar777joined
02:06:03  * piscisaureus_quit (Quit: ~ Trillian Astra - www.trillian.im ~)
02:07:08  * lohkeypart
02:07:32  * lohkey_joined
02:07:32  * lohkey_quit (Client Quit)
02:14:10  * warzquit
02:27:41  * TooTallNatequit (Quit: ["Textual IRC Client: www.textualapp.com"])
02:30:43  * tommybergeronquit (Quit: Linkinus - http://linkinus.com)
03:02:32  * ericktjoined
03:06:06  * loladiroquit (Quit: loladiro)
03:15:25  * stagasquit (Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204])
03:16:32  * loladirojoined
03:21:10  * loladiroquit (Ping timeout: 250 seconds)
03:24:15  * loladirojoined
03:33:46  * dapquit (Quit: Leaving.)
03:46:13  * brsonquit (Quit: leaving)
04:51:55  * ericktquit (Quit: erickt)
05:11:19  * jmar777quit (Remote host closed the connection)
05:15:19  * bnoordhuisjoined
05:19:50  * mikealjoined
06:26:58  * benoitcquit (Excess Flood)
06:30:55  * benoitcjoined
07:11:40  <MI6>joyent/libuv: Ben Noordhuis master * b4168cd : build: rename LINKFLAGS to LDFLAGS (+1 more commits) - http://git.io/Mk3gvg
07:13:21  * travis-cijoined
07:13:21  <travis-ci>[travis-ci] joyent/libuv#933 (master - b4168cd : Ben Noordhuis): The build passed.
07:13:21  <travis-ci>[travis-ci] Change view : https://github.com/joyent/libuv/compare/2e4488f35af8...b4168cd69738
07:13:21  <travis-ci>[travis-ci] Build details : http://travis-ci.org/joyent/libuv/builds/3562601
07:13:21  * travis-cipart
07:19:15  * rendarjoined
07:23:54  * mikealquit (Quit: Leaving.)
07:32:01  * mikealjoined
07:33:50  * mikealquit (Client Quit)
07:35:01  * mikealjoined
07:35:10  * mikealquit (Client Quit)
07:49:12  * bnoordhuisquit (Read error: Operation timed out)
07:58:36  * Ralt_joined
08:08:13  * joshthecoderjoined
08:14:26  * Ralt_quit (Ping timeout: 255 seconds)
08:21:41  * Ralt_joined
08:29:11  * joshthecoderquit (Quit: Leaving...)
08:55:29  * loladiroquit (Quit: loladiro)
08:56:26  * loladirojoined
09:02:45  * CoverSlidequit (Ping timeout: 248 seconds)
09:04:14  * CoverSlidejoined
09:12:52  * loladiroquit (Quit: loladiro)
09:14:03  * loladirojoined
09:16:40  * mmalecki[out]changed nick to mmalecki
09:23:30  * loladiroquit (Quit: loladiro)
09:35:12  * Ralt_quit (Ping timeout: 276 seconds)
10:12:49  * AvianFluquit (Remote host closed the connection)
10:21:15  * felixgejoined
10:21:15  * felixgequit (Changing host)
10:21:15  * felixgejoined
10:52:04  * stagasjoined
11:20:52  * AvianFlujoined
11:59:45  * felixge_joined
11:59:45  * felixgequit (Read error: Connection reset by peer)
11:59:45  * felixge_changed nick to felixge
12:03:21  * Ralt_joined
12:05:48  * `3rdEdenjoined
12:31:56  * Ralt_quit (Ping timeout: 250 seconds)
12:34:27  * dscapequit (Remote host closed the connection)
12:40:37  * AvianFluquit (Remote host closed the connection)
12:53:35  * hzjoined
13:04:16  * Ralt_joined
13:04:45  * hzquit (Disconnected by services)
13:04:49  * hzjoined
13:09:58  * bnoordhuisjoined
13:17:20  * dscapejoined
13:32:33  * `3rdEdenquit (Remote host closed the connection)
13:33:07  * Ralt_quit (Ping timeout: 260 seconds)
13:37:54  <indutny>bnoordhuis: hoya
13:37:59  <bnoordhuis>indutny: hey
14:00:32  * benoitcquit (Excess Flood)
14:06:28  * benoitcjoined
14:09:01  * `3rdEdenjoined
14:11:09  * ArmyOfBrucequit (Excess Flood)
14:11:39  * ArmyOfBrucejoined
14:32:46  * felixgequit (Quit: felixge)
15:07:19  * hzquit
15:15:31  <indutny>oh
15:15:31  <indutny>back
15:17:47  * Ralt_joined
15:21:11  <bnoordhuis>indutny: want to see something strange?
15:21:19  <indutny>yes
15:21:49  <bnoordhuis>https://gist.github.com/3b7b6a372e643041c79d <- try with both `./accept-server 2 0` and `./accept-server 2 1`
15:22:01  <bnoordhuis>and run `./accept-client 32` from another terminal
15:22:26  <bnoordhuis>on linux, performance with 2 1 (i.e. 1 ns nanosleep backoff) is wildly erratic
15:22:49  <bnoordhuis>i mean, throughput times are all over the place, from 50 us to several ms
15:23:17  <indutny>hm...
15:23:45  <indutny>what I'm wondering now
15:23:51  <indutny>is how nginx and apache handling this?
15:24:04  <bnoordhuis>i believe they don't :)
15:24:07  <indutny>are they doing accept()s only in one thread?
15:24:20  <indutny>ook
15:24:22  <bnoordhuis>for nginx the answer is yes
15:24:27  <indutny>oook
15:24:28  <indutny>so
15:24:44  <bnoordhuis>but apache does accept() from multiple threads/processes
15:24:45  <indutny>as I understand - we can't just simply transfer fd from one fork to another
15:24:50  <indutny>because of execv()
15:24:51  <bnoordhuis>but they don't insert delays
15:24:56  <indutny>bnoordhuis: and?
15:25:01  <indutny>bnoordhuis: they're balancing pretty well
15:25:23  <indutny>I think you're forcing context switches here
15:25:32  <bnoordhuis>no, not really - but it's usually not an issue because they generally don't do anything long lived
15:25:45  <bnoordhuis>re forcing context switch, that's precisely the goal
15:25:51  <indutny>but
15:25:54  <bnoordhuis>in order to distribute the load more fairly
15:25:55  <indutny>it's slow
15:25:58  <indutny>I understand
15:26:01  <indutny>but it's slow :P
15:26:12  <indutny>also
15:26:19  <indutny>load depends on another thing
15:26:27  <indutny>i.e. load is usually req/sec
15:26:30  <indutny>not just CPU load
15:26:37  <indutny>and even more interstingly
15:26:51  <indutny>this balancing doesn't work well at all, if all computation is happening in another threads
15:27:23  <indutny>because accept() call is always happening at the same periodity
15:27:36  <indutny>even if 15 other threads are 100% busy
15:27:52  <bnoordhuis>i think you're missing the issue here
15:27:55  <bnoordhuis>wait, let me link you
15:28:04  <bnoordhuis>https://github.com/joyent/libuv/issues/624 <- this
15:28:31  <bnoordhuis>so the thing is, it works okay when threads/processes=3,4 or greater
15:28:47  <bnoordhuis>but it crawls to a slow when there are just two
15:29:07  <indutny>hm...
15:29:14  <indutny>it wasn't really working weel on my 12 core machine
15:29:50  <bnoordhuis>try the test with e.g. `./accept-server 8 1`
15:30:03  <indutny>meh
15:30:05  <indutny>too lazy :P
15:30:12  <indutny>I need to download files one by one
15:30:37  <bnoordhuis>git clone?
15:30:41  <indutny>ok ok
15:32:45  <bnoordhuis>let's see what happens when i change the scheduling priority
15:33:18  * dapjoined
15:34:31  <indutny>heh
15:34:36  <indutny>no monothonic clock on osx
15:34:48  <indutny>starting vm
15:35:01  * ArmyOfBrucequit (Excess Flood)
15:35:29  * ArmyOfBrucejoined
15:37:12  <indutny>bnoordhuis: 2 1 works much better for me
15:37:23  <bnoordhuis>indutny: what kernel?
15:37:36  <indutny>3.5.0-18-generic
15:37:57  <indutny>2 0 almost everytime hits cpu 0
15:38:08  <indutny>btw
15:38:16  <bnoordhuis>how many vcpus does it have?
15:38:20  <indutny>2
15:38:31  <bnoordhuis>hm...
15:38:34  <indutny>yea
15:38:36  <indutny>it hits cpu 1
15:38:39  <indutny>but quite rare
15:39:12  <indutny>ah
15:39:17  <indutny>2 1 does the same
15:39:19  <indutny>nvm
15:39:27  <indutny>it's hitting cpu 0 mostly
15:39:47  <indutny>also, you're not closing sockets properly...
15:39:49  <indutny>in client
15:40:26  <bnoordhuis>what do you mean?
15:41:12  <indutny>well, I'm running out of ephemeral ports in like 10 seconds
15:41:39  <indutny>I can test it on bare metal
15:41:43  <indutny>if you'll give me a second
15:43:06  <bnoordhuis>indutny: sysctl net.ipv4.ip_local_port_range="10000 65535"
15:43:35  <indutny>yes, will do
15:43:39  <indutny>in 10-15 minutes
15:43:42  <indutny>I need to grab some tea
15:43:46  <bnoordhuis>you may want to set net.ipv4.tcp_tw_reuse and net.ipv4.tcp_tw_recycle as well
16:00:52  <indutny>ok
16:00:53  <indutny>back
16:02:01  <bnoordhuis>indutny: i've tweaked it to set a low SO_LINGER
16:02:07  <indutny>oh
16:02:08  <indutny>cool
16:03:07  <bnoordhuis>and you know? it makes all the difference...
16:03:17  <bnoordhuis>i mean, i get good throughput now
16:03:51  <bnoordhuis>but why did nprocs=2 or nprocs=4 make a difference before that?
16:04:32  <indutny>ok
16:04:34  <indutny>tested it again
16:04:41  <indutny>heh
16:04:49  <indutny>tcp driver problems?
16:04:55  <indutny>btw
16:04:59  <indutny>2 0 works better for me
16:05:04  <indutny>at least total time is less
16:05:07  <indutny>28ms
16:05:07  <bnoordhuis>yeah, that's expected
16:05:11  <indutny>vs 60m
16:05:14  <indutny>ok
16:05:20  <bnoordhuis>but if you were to measure the distribution across processes
16:05:31  <bnoordhuis>you'd find that they're very unbalanced
16:05:39  <indutny>oook
16:05:40  <bnoordhuis>e.g. 90% of all accepts are done in one process
16:05:47  <indutny>it happens
16:05:58  <bnoordhuis>yes, but it's not good
16:06:10  <bnoordhuis>it was a real issue for the c9 proxy
16:06:23  <bnoordhuis>because one process would get overloaded while the others just sat there
16:06:36  <indutny>hm...
16:06:37  * `3rdEdenquit (Remote host closed the connection)
16:06:39  <indutny>ok
16:06:44  <indutny>interesting
16:10:58  <indutny>so what can we do about it?
16:12:54  * Ralt_quit (Remote host closed the connection)
16:18:19  <bnoordhuis>accept2: 8055 accepts/sec (250000 total) thread #0: 4136 accepts/sec (128365 total, 51.3%) thread #1: 3919 accepts/sec (121635 total, 48.7%)
16:18:43  <bnoordhuis>^ tcp_multi_accept2 works when i turn off linger
16:18:49  <bnoordhuis>son of a...
16:18:52  <indutny>ahhaha
16:19:02  <indutny>you remember my pull request? :)
16:19:08  <indutny>with linger off?
16:19:17  <bnoordhuis>or rather, with a 1 ms timeout
16:19:26  <bnoordhuis>which amounts to off in my book
16:19:33  <indutny>yeah
16:19:38  <bnoordhuis>or is it measured in seconds? i always forget
16:19:59  <bnoordhuis>ah, seconds. anyway
16:20:17  <indutny>does it matter?
16:20:21  <indutny>you're passing 0 anyway
16:20:31  <indutny>right?
16:20:44  <bnoordhuis>no, i'm setting it to 1. linux doesn't like linger=1 timeout=0
16:20:51  <indutny>oh
16:20:55  <indutny>shit
16:27:49  * AvianFlujoined
16:31:10  * bnoordhuisis off to dinner
16:33:55  * jmar777joined
16:37:09  * `3rdEdenjoined
16:45:48  * `3rdEdenquit (Ping timeout: 264 seconds)
17:40:16  * hzjoined
18:06:35  * felixgejoined
18:26:14  * lohkeyjoined
18:26:20  * lohkeyquit (Client Quit)
18:38:19  * felixgequit (Quit: felixge)
18:39:46  * felixgejoined
18:41:22  * felixgequit (Client Quit)
18:56:18  * `3rdEdenjoined
18:58:29  * loladirojoined
19:02:55  * `3rdEdenquit (Remote host closed the connection)
19:23:27  * TooTallNatejoined
19:23:27  * TooTallNatequit (Client Quit)
19:26:29  * ericktjoined
19:26:55  * bnoordhuisquit (Ping timeout: 265 seconds)
19:27:51  * Raynosquit (Remote host closed the connection)
20:00:35  * wavdedquit (Remote host closed the connection)
20:00:35  * dscape_joined
20:00:35  * indutnyquit (Remote host closed the connection)
20:00:35  * dscapequit (Remote host closed the connection)
20:03:48  * wavdedjoined
20:03:49  * indutnyjoined
20:04:29  * benoitcquit (Excess Flood)
20:06:31  * benoitcjoined
20:36:19  * brsonjoined
20:42:09  * benoitcquit (Excess Flood)
20:47:05  * loladiroquit (Quit: loladiro)
20:49:33  * benoitcjoined
21:26:28  * ericktquit (Quit: erickt)
21:33:46  * loladirojoined
21:41:05  * loladiropart
21:58:23  * joshthecoderjoined
22:11:13  * `3rdEdenjoined
22:17:38  * benoitcquit (Excess Flood)
22:19:04  * benoitcjoined
22:20:53  * loladirojoined
22:27:42  * `3rdEdenquit (Remote host closed the connection)
22:31:14  * warzjoined
22:31:15  * warzquit (Changing host)
22:31:15  * warzjoined
22:38:28  * benoitcquit (Excess Flood)
22:44:24  * ericktjoined
22:45:04  * benoitcjoined
22:53:54  * Raynosjoined
23:02:47  * benoitcquit (Excess Flood)
23:04:34  * benoitcjoined
23:07:32  * joshthecoderquit (Quit: Leaving...)
23:09:49  * rendarquit
23:11:06  * hzquit
23:11:39  * piscisaureus_joined
23:12:29  <piscisaureus_>hey indutny, yt?
23:12:36  <indutny>hey bert
23:12:37  <indutny>yes
23:12:39  <indutny>still there
23:31:48  * piscisaureus_quit (Ping timeout: 252 seconds)