An asyncio health-checker is no faster than a sequential loop.
AdvancedTroubleshootingConcurrency, async, tests, services & containers
Answer
Likely causes → Blocking calls inside coroutines (requests.get, time.sleep, boto3), which freeze the event loop; or awaiting each task one by one in a for loop instead of running them concurrently.
Diagnose →
PYTHONASYNCIODEBUG=1 python checker.py # logs "Executing <Task ...> took 1.2 seconds"
Fix → Use async clients (httpx.AsyncClient, aiohttp), await asyncio.sleep, offload unavoidable blocking calls with asyncio.to_thread, and run concurrently with gather or TaskGroup.
Prevent → Code review rule: no sync I/O inside async def.
More on Concurrency, async, tests, services & containers
`RuntimeError: asyncio.run() cannot be called from a running event loop` in a Jupyter notebook or inside an async framework.Intermediate`RuntimeWarning: coroutine 'fetch' was never awaited` and nothing happens.Beginner`Task was destroyed but it is pending!` at shutdown.Advanced`OSError: [Errno 24] Too many open files` from an asyncio scanner with 20,000 targets.IntermediateA `ThreadPoolExecutor` job finishes "successfully" but half the work is missing, with no errors logged.IntermediateIntermittent `KeyError: 'credential_provider'` or `KeyError: 'endpoint_resolver'` when creating boto3 clients from many threads.Advanced