Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Write behind response buffering #131

Merged
merged 6 commits into from
Jul 28, 2015
Merged

Write behind response buffering #131

merged 6 commits into from
Jul 28, 2015

Conversation

halter73
Copy link
Member

  • Reduce calls to uv_write by calling it with multiple buffers when possible
  • Complete WriteAsync Tasks early when there are less than 64KB buffered
  • Add sample that can produce large responses

TODO:

  • Determine why this causes kestrel to progressively slow down on mono as more requests are handled.
  • Use Marshal.AllocCoTaskMem to allocate buffers.
  • Pool buffers.

#117

@halter73
Copy link
Member Author

@lodejard

@halter73 halter73 force-pushed the buffer branch 2 times, most recently from 32c1bd4 to 62d22e0 Compare July 22, 2015 19:33
@lodejard
Copy link
Contributor

:shipit:

@halter73 halter73 force-pushed the buffer branch 2 times, most recently from d2e8052 to d4e8339 Compare July 28, 2015 02:41
halter73 added 6 commits July 28, 2015 16:57
- In this case we are off the event loop, so we can invoke the callback directly.
- Increase _maxBytesBufferedBeforeThrottling
- Added a MockLibUv class
- Create a SocketOutputTests class
- Complete in this context means that the callback gets invoked.
- Previously, calls to write would never complete if the buffer contained
  more than 64 KB (_maxBytesPreCompleted).
- This is tested by SocketOutputTests.CanWrite1MB.
@halter73 halter73 merged commit 47d7f73 into dev Jul 28, 2015
@halter73 halter73 deleted the buffer branch July 28, 2015 23:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants