A service starts failing with EMFILE errors. Describe how you identify the cause and fix it.
- Check ulimit/systemd limits and kernel fs.file-max
- Use lsof to find FD leaks (sockets, files, inotify)
- Audit connection pools and HTTP client reuse
- Raise limits safely and patch leak in code
- Add FD usage dashboards and alerts
- 💡In-flight HTTP clients may leak sockets.
- ⚠️Only checking `ulimit` and not considering systemd's `LimitNOFILE` directive.
- ⚠️Forgetting to check global system limits (`fs.file-max`) when individual process limits seem sufficient.
- ⚠️Not using `lsof` effectively to filter or analyze the output for specific FD types (e.g., sockets).
- ⚠️Focusing solely on code logic and neglecting external dependencies or libraries for FD leaks.
- ⚠️Implementing a fix without understanding the root cause, leading to recurring issues.
- ❓How to tune systemd service limits?
- ❓What about ephemeral ports?
Ready to prove your AWS SysOps knowledge?
Practice with free SysOps Administrator Associate (SOA-C02) exam questions. Instant answers and detailed explanations — no account required.
Start free practice quizQuestions that share similar topics with this one
Kernel Panic and Node Reboot Loop
AdvancedCheck Disk Space in Linux
BeginnerSSH Keys vs Password Authentication
BeginnerFind Top CPU Processes in Linux
BeginnerCron Expression Basics
BeginnerDeepen your knowledge with these related blog posts
Taming Toil: Eliminating Repetitive Work to Scale SRE Teams
Toil kills engineering velocity and burns out teams. Learn how to measure, reduce, and automate toil in SRE and DevOps environments — with actionable best practices, anti-patterns, and case studies.
The Pragmatic SRE Guide to SLOs: From Business Goals to Error Budgets
Go beyond uptime percentages—learn how to map business goals into user-centric SLOs, define error budgets, and set up actionable alerting with real-world examples.
Real-Time Monitoring with eBPF: Low-Overhead Insights for Linux & K8s
eBPF is reshaping observability by enabling low-overhead, high-fidelity monitoring directly from the Linux kernel. Learn how it works, practical use cases, and tooling for real-time insights.