From abc1e3edb21a5e6925fa4c856657559608a8d65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=2E=20K=C3=A4rkk=C3=A4inen?= Date: Thu, 26 Mar 2020 16:55:00 +0200 Subject: [PATCH] 256 KiB send and receive buffers. --- sanic/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sanic/server.py b/sanic/server.py index d6450920..0a4c7d1d 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -224,7 +224,7 @@ class HttpProtocol(asyncio.Protocol): 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()) @@ -254,8 +254,8 @@ class HttpProtocol(asyncio.Protocol): 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: