unix
18 minLinux Under Load: Epoll, File Descriptors, OOM, TCP Queues, and VFS
Connect kernel readiness APIs, resource limits, cgroups, socket queues, page cache, and inode behavior to production symptoms.
Loading page...
unix
18 minConnect kernel readiness APIs, resource limits, cgroups, socket queues, page cache, and inode behavior to production symptoms.
python
6 minUse a bounded asyncio queue to distinguish accepted work, active work, and completed work.
typescript
8 minUse for-await consumption, cancellation, and iterator return semantics without hiding queues.
Q&A
Q&AEvery accepted item has been acknowledged, not necessarily committed successfully.
A bounded queue limits waiting items; workers hold additional active items. task_done releases unfinished-item accounting, while business success and durable retries require separate records.
Q&A
Q&ABound concurrency and queue depth at the scarce resource, and enforce an end-to-end deadline.
Use bounded connection pools, semaphores or worker queues, request deadlines, and deliberate overload responses. Local limits must account for replica count because each replica has its own pool. Avoid unbounded in-memory tasks and retries that amplify load during an incident.
Q&A
Q&AA live root still reaches an object, class, or thread state owned by the old loader.
Look for parent-owned registries, executor queues, thread locals, context class loaders, and callbacks. An unreachable cycle can be collected; a path from a long-lived root cannot.
Q&A
Q&ANo; an adapter can hide an unbounded push queue behind a pull-shaped interface.
A consumer can request one item at a time, but callback-backed sources still need an explicit capacity and overflow policy. Tie early iterator exit and cancellation to resource cleanup.
Q&A
Q&AAsync is best for I/O-bound work, while threads and workers are better for CPU-bound tasks or blocking libraries.
Use async when the code is mostly waiting on IO such as database calls, HTTP requests, or message queues. Use threads or process pools for CPU-intensive work or code that cannot cooperate with the event loop. The key is matching the concurrency model to the bottleneck, not adding async everywhere because it seems modern.