Nginx failed (24: Too many open files)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Content Cache Charm |
Fix Released
|
High
|
Haw Loeung |
Bug Description
Hi,
On a heavily loaded server, we're seeing Nginx spewing too many open files for both accessing files on disk as well as for TCP connections:
| 2021/11/22 22:58:12 [crit] 17293#17293: *154644983 open() "/var/lib/
| 2021/11/22 23:03:24 [crit] 17293#17293: accept4() failed (24: Too many open files)
It uses the system default limits:
| $ for i in $(pidof nginx); do sudo cat /proc/$i/limits | grep open; done
| Max open files 1024 4096 files
| Max open files 1024 4096 files
| ...
Adding "worker_
| $ for i in $(pidof nginx); do sudo cat /proc/$i/limits | grep open; done
| Max open files 8192 8192 files
| Max open files 8192 8192 files
We should fix the charm to bump this and make it configurable / automatically calculated.
Related branches
- 🤖 Canonical IS Review Bot: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 54 lines (+9/-2)2 files modifiedlib/haproxy.py (+6/-0)
reactive/content_cache.py (+3/-2)
- Barry Price: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 289 lines (+151/-24)6 files modifiedlib/nginx.py (+41/-12)
reactive/content_cache.py (+10/-3)
tests/unit/files/nginx-worker-rlimit-nofile.conf (+26/-0)
tests/unit/files/nginx.conf (+1/-1)
tests/unit/test_content_cache.py (+47/-0)
tests/unit/test_nginx.py (+26/-8)
Changed in content-cache-charm: | |
assignee: | nobody → Haw Loeung (hloeung) |
importance: | Undecided → High |
status: | New → Triaged |
Changed in content-cache-charm: | |
status: | Triaged → In Progress |
Changed in content-cache-charm: | |
status: | In Progress → Fix Committed |
Changed in content-cache-charm: | |
status: | Fix Committed → In Progress |
Changed in content-cache-charm: | |
status: | In Progress → Fix Released |