Skip to content

Commit

Permalink
256 KiB send and receive buffers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tronic committed Mar 26, 2020
1 parent e4a9b43 commit abc1e3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sanic/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def close(self):
def connection_made(self, transport):
try:
# TODO: Benchmark to find suitable write buffer limits
transport.set_write_buffer_limits(low=16384, high=65536)
transport.set_write_buffer_limits(low=16384, high=262144)
self.connections.add(self)
self.transport = transport
self._task = self.loop.create_task(self.connection_task())
Expand Down Expand Up @@ -254,8 +254,8 @@ def data_received(self, data):
return self.close()
self.recv_buffer += data

# Buffer up to 64 KiB (TODO: configurable?)
if len(self.recv_buffer) > 65536:
# Buffer up to 256 KiB (TODO: configurable?)
if len(self.recv_buffer) > 262144:
self.transport.pause_reading()

if self._data_received:
Expand Down

0 comments on commit abc1e3e

Please sign in to comment.