有人可以好心地向我解释如何解决这个问题吗?
在日志中nginx打印:
2015/06/24 11:12:19 [alert] 2151#0: mmap(MAP_ANON|MAP_SHARED, 33554432) failed (12: Cannot allocate memory)
nginx.conf
user developer;
worker_processes auto;
pid /run/nginx.pid;
events {
use epoll;
worker_connections 30;
multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 65;
keepalive_timeout 2;
types_hash_max_size 2048;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_min_length 1000;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# MY CHANGES
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_stapling on;
resolver 8.8.8.8;
geoip_country /srv/www/geoipdb/GeoIP.dat;
geoip_city /srv/www/geoipdb/GeoLiteCity.dat;
# Support the X-Forwarded-Proto header for fastcgi.
map $http_x_forwarded_proto $fastcgi_https {
default $https;
http '';
https on;
}
variables_hash_max_size 1024; # default 512
upload_progress uploads 1m;
include /etc/nginx/conf.d/*.conf;
include apps/drupal/map_cache.conf;
include /etc/nginx/sites-enabled/*;
}
猫/etc/sysctl.conf
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
我有配备 4G RAM 的 vps。在 plesk 内存选项卡中我看到:
http://itmages.ru/image/view/2669317/4ab8f2d4
提前谢谢!
答案1
删除 nginx-extras 包后问题解决