I am running a VPS on digitalocean. I have daily traffic of 500 unique users. I was having CPU and RAM utilization problems on Apache. Now I am using Nginx because it's lightweight. My CPU and RAM is under control but still Nginx shows an error message from time to time, which I believe is due to load/wrong configuration.
I am getting this error in my log files:
ngx_slab_alloc() failed: no memory in SSL sessionI have the following configuration for my nginx server:
keepalive_timeout 20;
ssl_session_timeout 7200m;
ssl_session_cache shared:SSL:150m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;What is the right configuration for me, considering I am running a VPS with 1Gb RAM?
Would using a database sessions table (as in Laravel) solve my problem, independent from the Nginx configuration?
21 Answer
Reduce ssl_session_timeout and ssl_session_cache values. Please check the link for nginx https server configuration and server optimization.