1. 程式人生 > >nginx 軟重啟報錯 mmap(MAP_ANON|MAP_SHARED, 524288000) failed (12: Cannot allocate memory)

nginx 軟重啟報錯 mmap(MAP_ANON|MAP_SHARED, 524288000) failed (12: Cannot allocate memory)

解決辦法

將配置檔案的 httpproxy_cache_path 由500改為300

proxy_cache_path /usr/local/nginx/proxy_cache_path levels=1:2 keys_zone=cache_one: 300m inactive=1d max_size=10g;
proxy_temp_path /usr/local/nginx/proxy_temp_path;

測試

[email protected]:/etc/nginx$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

重啟即可

sudo nginx -s reload