Hello, need help with leaking memory
i installed fresh system , centos7.1 +directadmin + nginx1.8.0 +
mariadb5.5.41 + php54 & php56 both with php_fpm
the server it for webhosting and i have there 32gb for now have only 4
website on it, and after 1-2hours nginx take all memory when it come to
96%
it stop there and then all websites fall but nginx not, only after i
reset
nginx all back to normal for 1-2hours again.
how can i debug where the problem? or try find the problem? seems in
logs i
not see anything
ok need help, it not security_mod, it begin grow again.
when server begin activate, i mean users begin upload files or replace
files
the memory increase immediately and not going down after they finish.
now the server ate 12gb of ram, if i do reset to nginx it going down to
4.5gb ram.
# For user configurations not maintained by DirectAdmin. Empty by
default.
include /etc/nginx/nginx-includes.conf;
# Supplemental configuration
include /etc/nginx/nginx-modsecurity-enable.conf;
include /etc/nginx/nginx-defaults.conf;
include /etc/nginx/nginx-gzip.conf;
include /etc/nginx/directadmin-ips.conf;
include /etc/nginx/directadmin-settings.conf;
include /etc/nginx/nginx-vhosts.conf;
include /etc/nginx/directadmin-vhosts.conf;
===================================
config for nginx/directadmin-ips.conf:
server {
listen xx.xx.xx.xx:80 default_server; // i hide the ip
server_name _;
root /home/admin/domains/sharedip;
index index.html index.htm index.php;
include /usr/local/directadmin/data/users/admin/nginx_php.conf;
# deny access to apache .htaccess files
location ~ /\.ht
{
deny all;
}
include /etc/nginx/webapps.conf;
}
server {
listen xx.xx.xx.xx:443 default_server; // i hide the ip
server_name _;
===========================
config for directadmin-settings.conf:
empty
===========================
config for nginx-vhosts.conf
server {
listen xx.xx.xx.x:80; // i hide the ip
listen 127.0.0.1:80;
#listen [::1]:80;
server_name $hostname xx.xx.xx.xx; / i hide the ip
root /var/www/html;
index index.html index.htm index.php;
#Support UserDir (~/user/)
location ~^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
#try_files does not work after alias directive
if (!-f $request_filename) {
return 404;
}
fastcgi_param DOCUMENT_ROOT
“nginx recompile, because the module could be still hooking in
requests.”
security_mod disabled it not tracker after any domains on the server it
cant
hooking requersts if it not tracking after domains
becuse memory leaking only when clients do traffic with domains.
i for sure now it not security_mod problem and about version i use
mod_security it last one
Current rules version 1.11 (Latest version)
CWAF plugin version 2.11 (Latest version)
i thinking of php-fpm problems with nginx, i google a little and saw
people
complain about leaking in nginx who have php-fpm
i only not understand why pm = ondemand doing the leaking, does algorithem
in nginx not stable or it php issue ?
It contradicts your previous mails about nginx processes being the leak
point.
php(-fpm) and nginx are separate pieces of software (just communicating
via
fastcgi protocol) so if the php leaks memory it’s a problem on php side
(is
also very valid considering that not all of the (third-party) php
extensions
are memory-friendly).
after i change it to this conf the leaking stoped.
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
Very probably that last setting helped you, from the documentation:
pm.max_requests int
The number of requests each child process should execute before
respawning. This can be useful to work around memory leaks in 3rd party
libraries. For endless request processing specify ‘0’. Equivalent to
PHP_FCGI_MAX_REQUESTS. Default value: 0.
IMHO It’s a bandaid, but works.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.