yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* beware of lowering TCP buffer sizes under Linux
@ 2015-05-21  0:10 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-05-21  0:10 UTC (permalink / raw)
  To: yahns-public

On Linux, the (currently) excessively large memory buffers size
defaults hide some bugs in the TCP implementation regarding
edge-triggered epoll wakeups.

Setting low :sndbuf values (or lowering tcp_wmem/tcp_mem) can cause
problems) for servers using edge-triggered I/O.  yahns uses one-shot
epoll (a special case of edge-triggering), so is also affected;
nginx uses edge-triggering, so it would also be affected.

Most other epoll users I know about use level-triggering, so are not
affected.

For now, leaving buffers at defaults should be sufficient and I've
yet to encounter this problem in the wild with default settings on
current kernels.

These problems are being worked on in netdev@vger.kernel.org:

http://mid.gmane.org/20150520155253.86202203D@prod-mail-relay06.akamai.com
http://mid.gmane.org/20150506155223.9743A2027@prod-mail-relay06.akamai.com
http://mid.gmane.org/1431718770-3815-1-git-send-email-edumazet@google.com

Fwiw, I have encountered and helped fix missing wakeup bugs in Linux
before, and I'm sure there'll be new bugs found in the future when
handling millions of sockets.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-21  0:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21  0:10 beware of lowering TCP buffer sizes under Linux Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).