Title: TLS/SSL asyncio leaks memory · Issue #109534 · python/cpython · GitHub
Open Graph Title: TLS/SSL asyncio leaks memory · Issue #109534 · python/cpython
X Title: TLS/SSL asyncio leaks memory · Issue #109534 · python/cpython
Description: Bug report Bug description: python3.9 without uvloop doesn't leaks memory (or noticeably smaller). python3.11+ (and others?) leaks memory A LOT under load (with or without uvloop) - up to +2gb per every test! test commands: ab -n50000 -c...
Open Graph Description: Bug report Bug description: python3.9 without uvloop doesn't leaks memory (or noticeably smaller). python3.11+ (and others?) leaks memory A LOT under load (with or without uvloop) - up to +2gb per ...
X Description: Bug report Bug description: python3.9 without uvloop doesn't leaks memory (or noticeably smaller). python3.11+ (and others?) leaks memory A LOT under load (with or without uvloop) - up to +2gb ...
Opengraph URL: https://github.com/python/cpython/issues/109534
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TLS/SSL asyncio leaks memory ","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\npython3.9 without uvloop doesn't leaks memory (or noticeably smaller). \r\npython3.11+ (and others?) leaks memory A LOT under load (with or without uvloop) - up to +2gb per every test!\r\n\r\ntest commands: \r\nab -n50000 -c15000 -r https://127.0.0.1/\r\n(apt install apache2-utils)\r\n\r\n```python\r\nimport asyncio, ssl, uvloop\r\n\r\nclass HTTP(asyncio.Protocol):\r\n \r\n def __init__(self):\r\n self.transport = None\r\n \r\n def connection_made(self, transport):\r\n self.transport = transport\r\n\r\n def data_received(self, data):\r\n self.transport.write(\r\n b'HTTP/1.1 200 OK\\r\\nContent-Length: 0\\r\\nConnection: keep-alive\\r\\n\\r\\n'\r\n )\r\n self.transport.close()\r\n \r\ndef make_tls_context():\r\n ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\r\n ctx.load_cert_chain('cert.crt', 'cert.key')\r\n return ctx\r\n\r\ntls_context = make_tls_context()\r\nloop = uvloop.new_event_loop()\r\n\r\nasync def start_server(loop):\r\n return await loop.create_server(\r\n HTTP, '127.0.0.1', 443, backlog=65535,\r\n ssl=tls_context)\r\n\r\nloop.run_until_complete(start_server(loop))\r\nloop.run_forever()\r\n```\r\n### CPython versions tested on:\r\n\r\n3.9, 3.11, 3.12\r\n\r\n### Operating systems tested on:\r\n\r\nDebian Linux\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-113338\r\n* gh-114074\r\n* gh-114311\r\n* gh-114367\r\n* gh-114829\r\n* gh-114830\r\n* gh-115643\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/rojamit","@type":"Person","name":"rojamit"},"datePublished":"2023-09-18T11:49:46Z","url":"https://github.com/python/cpython/issues/109534"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:705ad84b-6fd0-a77b-0802-1f9332ea8359 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF8A:2E9293:181AED:201155:6AFE9552 |
| html-safe-nonce | 47045b2e9f62a57369720502d757a1dfeb7dd53f45723ba38a343e8e99a864bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjhBOjJFOTI5MzoxODFBRUQ6MjAxMTU1OjZBRkU5NTUyIiwidmlzaXRvcl9pZCI6IjE4MDYxNDczMzAxNzMyMTE5ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | afc2292afab3d468a615e996cf4ec326e2666028dbdaa84b2e8989475c4153c7 |
| hovercard-subject-tag | issue:1900764543 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/109534/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6320a5bf23c45b3839f4c3c28ddb430bac00e85f7b623bf9125f038fc763658e/python/cpython/issues/109534 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6320a5bf23c45b3839f4c3c28ddb430bac00e85f7b623bf9125f038fc763658e/python/cpython/issues/109534 |
| og:image:alt | Bug report Bug description: python3.9 without uvloop doesn't leaks memory (or noticeably smaller). python3.11+ (and others?) leaks memory A LOT under load (with or without uvloop) - up to +2gb per ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rojamit |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width