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.
- Loading branch information
1 parent
be9d1ce
commit 738b31e
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