2 ms·
"There's a dilemma though - if the application code is writing bytes to the response body with blocking write(), isn't it tying up a thread if the client is slo
by ninjakeyboard 12y ago
"There's a dilemma though - if the application code is writing bytes to
the response body with blocking write(), isn't it tying up a thread if
the client is slow?"
There are TCP buffers. If it gets full ya maybe you'll wait a bit but it's thread vs rope relative to blocking a whole big roundtrip data exchange while blocking a thread. Nobody really tunes the write buffers because it doesn't slow down our apps. That is not the case with calls to remote services.
Note that TCP buffers are pretty big so the chance of the thread blocking while writing are very low.