You raised nofile in limits.conf but the service still has 1024. Why?
IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer
/etc/security/limits.conf is applied by pam_limits to PAM login sessions (SSH, su, sudo). systemd services do not go through PAM, so they ignore it. Set the limit in the unit:
[Service]
LimitNOFILE=65536
sudo systemctl daemon-reload && sudo systemctl restart api
grep 'open files' /proc/$(systemctl show -p MainPID --value api)/limits
For a global default for all services, set DefaultLimitNOFILE= in /etc/systemd/system.conf.
More on Logs, Limits & High-Traffic Tuning
How does log management work on a modern Linux server?BeginnerWhy centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?Intermediate