Skip to content

Commit

Permalink
Avoid unnecessary body write scheduling in IIS (#34733)
Browse files Browse the repository at this point in the history
  • Loading branch information
halter73 committed Jul 26, 2021
1 parent 04c7c65 commit 33c24dc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Servers/IIS/IIS/src/Core/IISHttpContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,15 @@ protected void InitializeContext()

(RequestBody, ResponseBody) = _streams.Start();

var pipe = new Pipe(
new PipeOptions(
_memoryPool,
readerScheduler: PipeScheduler.ThreadPool,
pauseWriterThreshold: PauseWriterThreshold,
resumeWriterThreshold: ResumeWriterTheshold,
minimumSegmentSize: MinAllocBufferSize));
var pipe = new Pipe(new PipeOptions(
_memoryPool,
// The readerScheduler schedules internal non-blocking logic, so there's no reason to dispatch.
// The writerScheduler is PipeScheduler.ThreadPool by default which is correct because it
// schedules app code when backpressure is relieved which may block.
readerScheduler: PipeScheduler.Inline,
pauseWriterThreshold: PauseWriterThreshold,
resumeWriterThreshold: ResumeWriterTheshold,
minimumSegmentSize: MinAllocBufferSize));
_bodyOutput = new OutputProducer(pipe);
}

Expand Down

0 comments on commit 33c24dc

Please sign in to comment.