Nginx failed (24: Too many open files)

Bug #1951888 reported by Haw Loeung
8
This bug affects 1 person
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/nginx/proxy/XXX/d/de/YYY" failed (24: Too many open files), client: 127.0.0.1, server: XXX, request: "GET /_status/ping HTTP/1.0", host: "XXX"
| 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_rlimit_nofile 8192;" to /etc/nginx/nginx.conf helps bump this up:

| $ 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

Haw Loeung (hloeung)
Changed in content-cache-charm:
assignee: nobody → Haw Loeung (hloeung)
importance: Undecided → High
status: New → Triaged
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: Triaged → In Progress
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: In Progress → Fix Committed
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: Fix Committed → In Progress
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.