File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ the frequency of system calls or the need to pause reading or writing.
8888You should keep these buffers small. Increasing them can help with spiky
8989workloads but it can also backfire because it delays backpressure.
9090
91- * In the :mod: `asyncio ` implementation, there is no library-level read buffer.
91+ * In the :mod: `asyncio ` implementation, there is no library-level read buffer
92+ for plain TCP connections. There is a 256 KiB read buffer for TLS connections,
93+ plus 32KiB on Windows with the default event loop.
9294
9395 There is a write buffer. The ``write_limit `` argument of
9496 :func: `~asyncio.client.connect ` and :func: `~asyncio.server.serve ` controls its
@@ -107,6 +109,9 @@ workloads but it can also backfire because it delays backpressure.
107109 it drains under the low-water mark. This creates backpressure on the TCP
108110 connection.
109111
112+ In addition, there is a 256 KiB read buffer for TLS connections, plus 32KiB on
113+ Windows.
114+
110115 There is a write buffer. It as controlled by ``write_limit ``. It behaves like
111116 the :mod: `asyncio ` implementation described above.
112117
Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ Performance
55
66Here are tips to optimize performance.
77
8+ TLS
9+ ---
10+
11+ You should terminate TLS in a reverse proxy rather than in a websockets server.
12+
13+ This will reduce memory usage of the websockets server and improve performance.
14+
815uvloop
916------
1017
You can’t perform that action at this time.
0 commit comments