python system_error ai_generated true

aiohttp.client_exceptions.ClientOSError: [Errno 24] Too many open files

ID: python/aiohttp-connector-limit-exceeded

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-10-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.11 active

Root Cause

Too many concurrent connections exceed system file descriptor limit.

generic

中文

并发连接过多,超过系统文件描述符限制。

Workarounds

  1. 85% success
    connector = aiohttp.TCPConnector(limit=100, limit_per_host=10) # tune values
  2. 90% success
    Ensure session.close() and response.release() are always called

Dead Ends

Common approaches that don't work:

  1. 50% fail

  2. 40% fail