1

My centos 6.7 server has only my php and mysql based low-traffic websites (total around 3000 page views per day for all websites) using nginx web server and virtualmin (no wordpress or external scripts/software).

I installed PHP with :

yum --enablerepo=remi,remi-php56 install -y php-mysqlnd php-gd php-fpm

yum installed dependencies like php-commom, php-pdo etc.

I checked the running processes in my server using virtualmin.

immediately after restarting php-fpm, each php-fpm: pool www process is using around 400MB memory.

There are more than 20 extensions in etc/php.d directory.

I commented most of the extensions in etc/php.d directory.

after restarting php-fpm and nginx,

I checked the installed extensions using

<?php
print_r(get_loaded_extensions());
?>

This is the result :

[0] => Core
[1] => date
[2] => ereg
[3] => libxml
[4] => openssl
[5] => pcre
[6] => zlib
[7] => filter
[8] => hash
[9] => Reflection
[10] => SPL
[11] => session
[12] => standard
[13] => cgi-fcgi
[14] => curl
[15] => ftp
[16] => gd
[17] => mysqlnd
[18] => PDO
[19] => mysql
[20] => pdo_mysql
[21] => json
[22] => mhash

now immediately after restarting php-fpm, each php-fpm: pool www process is using around 250MB memory .

www.conf :

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

in php.ini

memory_limit = 128M

Running Processes in virtualmin :

 Real memory: 31.19 GB total / 21.17 GB free / 20.24 GB cached   Swap space: 1024 MB total / 341.19 MB free

ID      Owner       Size        Command   
46929   mysql   10.48 GB    /usr/sbin/mysqld --basedir=/usr --datadir=/home/mysql-data --plugin-dir=/var/lib ...
45061   dkim-milter     1.96 GB     /usr/sbin/dkim-filter -x /etc/mail/dkim-milter/dkim-filter.conf -P /var/run/dkim ...
27380   sphinx  1.19 GB     /usr/bin/searchd --config /etc/sphinx/sphinx.conf
45056   named   709.38 MB   /usr/sbin/named -u named
56055   apache  614.07 MB   php-fpm: pool www
25919   apache  317.67 MB   php-fpm: pool www
19624   apache  305.90 MB   php-fpm: pool www
16654   apache  300.36 MB   php-fpm: pool www
24973   apache  295.33 MB   php-fpm: pool www
24559   apache  291.47 MB   php-fpm: pool www
30654   apache  285.20 MB   php-fpm: pool www
50347   apache  285.09 MB   php-fpm: pool www
19531   apache  254.57 MB   php-fpm: pool www
33874   apache  254.42 MB   php-fpm: pool www
15467   apache  253.65 MB   php-fpm: pool www
42002   apache  253.01 MB   php-fpm: pool www
40159   apache  251.92 MB   php-fpm: pool www
48884   apache  251.05 MB   php-fpm: pool www
1568    root    250.19 MB   /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
7628    apache  249.05 MB   php-fpm: pool www
52524   apache  247.92 MB   php-fpm: pool www
897     apache  247.14 MB   php-fpm: pool www
19972   apache  246.92 MB   php-fpm: pool www
44322   apache  246.64 MB   php-fpm: pool www
56975   apache  246.50 MB   php-fpm: pool www
28549   apache  246.42 MB   php-fpm: pool www
25728   apache  246.09 MB   php-fpm: pool www
65048   root    245.55 MB   php-fpm: master process (/etc/php-fpm.conf)
46044   root    105.76 MB   /bin/sh /usr/bin/mysqld_safe --datadir=/home/mysql-data --socket=/var/lib/mysql/ ...
43584   root    98.25 MB    /usr/libexec/webmin/proc/index_size.cgi
59312   root    97.63 MB    sshd: root@notty
27379   sphinx  90.30 MB    /usr/bin/searchd --config /etc/sphinx/sphinx.conf
15861   root    86.25 MB    /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
43585   root    86.25 MB    /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
43589   root    86.25 MB    /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
35690   postfix     79.22 MB    qmgr -l -t fifo -u
2723    postfix     79.05 MB    pickup -l -t fifo -u
39868   root    78.97 MB    /usr/libexec/postfix/master
24373   root    64.85 MB    /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -r
24374   root    64.85 MB    /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -r
24375   root    64.85 MB    /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -r
24376   root    64.85 MB    /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -r
24377   root    64.85 MB    /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -r
10485   root    64.67 MB    /usr/sbin/sshd
59383   root    56.03 MB    /usr/libexec/openssh/sftp-server
42540   nginx   54.42 MB    nginx: worker process
42545   nginx   54.19 MB    nginx: worker process
42539   nginx   53.52 MB    nginx: worker process
42542   nginx   53.52 MB    nginx: worker process
42543   nginx   53.36 MB    nginx: worker process
42538   nginx   53.32 MB    nginx: worker process
42546   nginx   53.32 MB    nginx: worker process
42544   nginx   53.23 MB    nginx: worker process
42537   root    49.33 MB    nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

Result of Top : sorted by memory usage:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
46929 mysql     20   0 10.5g 5.3g 4992 S  1.0 17.0 369:43.82 mysqld
27380 sphinx    20   0 1218m 463m 433m S  6.0  1.5 266:34.64 searchd
56055 apache    20   0  614m 373m 3964 S  2.3  1.2   5:09.57 php-fpm
25919 apache    20   0  323m  84m 5260 S  4.0  0.3   3:32.51 php-fpm
19624 apache    20   0  306m  66m 5048 S  4.6  0.2   7:02.03 php-fpm
16654 apache    20   0  300m  60m 4288 S  0.3  0.2   0:49.27 php-fpm
24973 apache    20   0  295m  54m 3944 S  0.7  0.2   1:18.91 php-fpm
45056 named     20   0  709m  51m 2500 S  0.7  0.2  21:01.48 named
24559 apache    20   0  291m  51m 4988 S  0.0  0.2   1:08.85 php-fpm
50347 apache    20   0  286m  46m 4964 S  1.3  0.1   0:40.13 php-fpm
30654 apache    20   0  285m  34m 7400 S  0.7  0.1   2:09.37 php-fpm
15861 root      20   0 88320  17m 1888 S  0.0  0.1   0:10.77 miniserv.pl
15467 apache    20   0  253m  15m 5428 S  0.0  0.0   0:28.92 php-fpm
42002 apache    20   0  253m  14m 5036 S  0.0  0.0   0:01.19 php-fpm
33874 apache    20   0  254m  14m 4012 S  0.0  0.0   1:48.74 php-fpm
42540 nginx     20   0 55724  12m 1052 S  0.0  0.0   0:11.45 nginx
42545 nginx     20   0 55492  12m 1052 S  0.0  0.0   0:12.47 nginx
40159 apache    20   0  251m  12m 4036 S  0.0  0.0   0:01.16 php-fpm
42539 nginx     20   0 54804  11m 1056 S  0.0  0.0   0:11.76 nginx
42542 nginx     20   0 54804  11m 1052 S  0.0  0.0   0:12.55 nginx
42543 nginx     20   0 54636  11m 1052 S  0.0  0.0   0:12.48 nginx
42544 nginx     20   0 54508  11m 1056 S  0.0  0.0   0:11.07 nginx
42546 nginx     20   0 54604  11m 1052 S  0.0  0.0   0:12.52 nginx
42538 nginx     20   0 54604  11m 1052 S  0.0  0.0   0:13.75 nginx
48884 apache    20   0  251m  11m 3996 S  0.0  0.0   0:01.19 php-fpm
52524 apache    20   0  247m 9800 3452 S  0.0  0.0   0:01.17 php-fpm
 7628 apache    20   0  249m 9296 3964 S  0.0  0.0   0:00.92 php-fpm
  897 apache    20   0  247m 8824 3460 S  0.0  0.0   0:01.07 php-fpm
19972 apache    20   0  246m 8300 3472 S  0.0  0.0   0:00.79 php-fpm
25728 apache    20   0  246m 7680 3436 S  0.0  0.0   0:00.38 php-fpm
28549 apache    20   0  246m 7404 3056 S  0.0  0.0   0:00.31 php-fpm
44322 apache    20   0  246m 7300 3088 S  0.0  0.0   0:00.65 php-fpm
56975 apache    20   0  246m 7220 3116 S  0.0  0.0   0:00.51 php-fpm
17463 apache    20   0  246m 7208 2968 S  0.0  0.0   0:00.05 php-fpm
42537 root      20   0 50516 6936  296 S  0.0  0.0   0:00.00 nginx
 1568 root      20   0  250m 6264  868 S  0.0  0.0   0:34.28 rsyslogd

click to view Top result sorted by memory usage

Please reply if you want to know any more details.

Please suggest.

Thanks.

6
  • 2
    Why do you believe that each php-fpm process is using 300MB of memory? You have shown nothing that indicates this. Oct 12, 2015 at 3:53
  • Sorry! added the running processes list.
    – Arnold
    Oct 12, 2015 at 15:51
  • Those numbers look wrong. I think virtualmin is lying to you. Log in to the server yourself and look at the list of processes. Oct 12, 2015 at 15:53
  • I have pasted the result of top command in the above post. Please check. Thank you.
    – Arnold
    Oct 12, 2015 at 16:04
  • Ah, virtualmin is lying. We can see your processes are using much less memory than it says (see the RES column). Oct 12, 2015 at 16:09

0

You must log in to answer this question.

Browse other questions tagged .