Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: disable relaxed accept() by default
Browse files Browse the repository at this point in the history
Don't use the relaxed accept() algorithm introduced in be2a217 unless
explicitly requested. It causes a 50+% performance drop on some node.js
benchmarks:

  $ alias bench='out/Release/node benchmark/http_simple_auto.js \
    -c 10 -n 50000 bytes/1 2>&1 | grep Req'

  $ UV_TCP_SINGLE_ACCEPT=0 bench
  Requests per second:    12331.84 [#/sec] (mean)

  $ UV_TCP_SINGLE_ACCEPT=1 bench
  Requests per second:    3944.63 [#/sec] (mean)
  • Loading branch information
bnoordhuis committed Dec 18, 2012
1 parent b86ed94 commit dc559a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {

if (single_accept == -1) {
const char* val = getenv("UV_TCP_SINGLE_ACCEPT");
single_accept = (val == NULL) || (atoi(val) != 0); /* on by default */
single_accept = (val != NULL && atoi(val) != 0); /* Off by default. */
}

if (single_accept)
Expand Down

0 comments on commit dc559a5

Please sign in to comment.