This repository has been archived by the owner on May 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
unix: fix loop starvation under high network load
uv__read() and uv__udp_recvmsg() read incoming data in a loop. If data comes in at high speeds, the kernel receive buffer never drains and said functions never terminate, stalling the event loop indefinitely. Limit the number of consecutive reads to 32 to stop that from happening. The number 32 was chosen at random. Empirically, it seems to maintain a high throughput while still making the event loop move forward at a reasonable pace. This is a back-port of commit 738b31e from the master branch. Conflicts: src/unix/stream.c
- Loading branch information
1 parent
dbe681e
commit 06e0319
Showing
2 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters