Couldn't obtain lock and too many open files error
Hi everyone!
I am using OpenResty and lua-resty-auto-ssl to generate SSL on the fly. OpenResty is acting as a reverse proxy to our Node.js app. It works great, but sometimes it just crashes with the following errors and never recovers.
issue_cert(): auto-ssl: failed to obtain lock: timeout, context: ssl_certificate_by_lua*,
and
[crit] 30999#0: accept4() failed (24: Too many open files)
I have to manually kill the process and restart to make it work. What could be the reason?
Some Info
OpenResty version: 1.11.2.2 lua-resty-auto-ssl: 0.12.0-1 Single core CPU with 3GB RAM lua_shared_dict auto_ssl: 1024m; lua_shared_dict auto_ssl_settings: 64k;
Also, it appears that this error occurs whenever there is an SSL generation error for specific domains. This issue might even be related to this -- I am not entirely sure though. Any help will be highly appreciated. :)
Update
Further investigation revealed that this happens whenever the certification generation is not able to complete for any reason. For example, when any domain is behind Cloudflare, the SSL generation fails and OpenResty becomes unresponsive.
Sandeep
Does anyone have an idea about this issue? Any help would be appreciated