Stew
By:
Stew

Apache Abnormal Memory Consumption, Causes?

April 30, 2017 239 views
Apache Ubuntu

Hello, i have a big big problem with Droplet

2 GB Memory / 40 GB Disk / NYC3 - Ubuntu 14.04.4 x64

After over 1 year use, seems now my drolet be affect by an unknow issues, an high ram consuption that stop all my websites.

Before move all my site on new droplet and destroy old, i want try fix it, so i am here to ask for help to community.

Information

  • Memory limit reach 100% and stay fix until droplet reboot and apache restart
  • After reboot and restart, websites working for 5 or 10 minutes, then memory consuption reach 100% and stay and i must restart apache and reboot droplet
  • Error occour also when no traffic is on the site
  • Error is no permanent and hit my droplet not more than 2 times in a days
  • Issues resolved after 6-10 times reboot and restart (droplet and apache), just for 2 days max or some hours.
  • All sites on the Droplet are Wordpress based.
  • Before never issues hit my droplet

Memory Consuption details

free -m
        total       used       free     shared    buffers     cached
Mem:          2001       1931         70        137          0        151
-/+ buffers/cache:       1778        222
Swap:         4095        188       3907

Here and image of GRAPHS: http://pasteboard.co/zg2icRnQ.jpg

Droplet workign good for some months with lots of websites on it, from issues incoming i removed 2 websites from server without any googd news.

Any help or suggestion will be appreciated
Thank you All!

3 Answers

Hi @Stew

There can be many reasons why, but I would think this might have something to do with PHP running as a module in Apache.
Let's see if the error logs tells us anything.

Can you run this command and post the list?

ls -lh /var/log/apache/

And then run this and post the output:

tail -50 /var/log/apache/error.log
  • output for
    ls -lh /var/log/apache2/

    total 1.4G
    -rw-r----- 1 root adm  5.3M Apr 30 11:08 access.log
    -rw-r----- 1 root adm  172M Apr 30 06:56 access.log.1
    -rw-r----- 1 root adm   31M Feb 27 06:45 access.log.10.gz
    -rw-r----- 1 root adm   19M Feb 19 06:58 access.log.11.gz
    -rw-r----- 1 root adm   21M Feb 13 06:49 access.log.12.gz
    -rw-r----- 1 root adm   15M Feb  5 06:34 access.log.13.gz
    -rw-r----- 1 root adm   21M Jan 30 06:52 access.log.14.gz
    -rw-r----- 1 root adm   17M Jan 22 06:43 access.log.15.gz
    -rw-r----- 1 root adm   22M Jan 16 06:47 access.log.16.gz
    -rw-r----- 1 root adm   18M Jan  8 06:56 access.log.17.gz
    -rw-r----- 1 root adm   24M Jan  2 06:55 access.log.18.gz
    -rw-r----- 1 root adm   16M Dec 25 06:54 access.log.19.gz
    -rw-r----- 1 root adm  170K Dec 20 06:53 access.log.20.gz
    -rw-r----- 1 root adm   46M Dec 20 05:48 access.log.21.gz
    -rw-r----- 1 root adm   24M Dec  5 06:30 access.log.22.gz
    -rw-r----- 1 root adm   22M Nov 27 06:48 access.log.23.gz
    -rw-r----- 1 root adm   21M Nov 20 06:38 access.log.24.gz
    -rw-r----- 1 root adm   22M Nov 14 06:39 access.log.25.gz
    -rw-r----- 1 root adm   18M Nov  6 06:53 access.log.26.gz
    -rw-r----- 1 root adm   19M Oct 30 06:37 access.log.27.gz
    -rw-r----- 1 root adm   24M Oct 24  2016 access.log.28.gz
    -rw-r----- 1 root adm   21M Oct 16  2016 access.log.29.gz
    -rw-r----- 1 root adm   23M Apr 23 06:41 access.log.2.gz
    -rw-r----- 1 root adm   17M Oct  9  2016 access.log.30.gz
    -rw-r----- 1 root adm   23M Oct  3  2016 access.log.31.gz
    -rw-r----- 1 root adm   17M Sep 25  2016 access.log.32.gz
    -rw-r----- 1 root adm   21M Sep 19  2016 access.log.33.gz
    -rw-r----- 1 root adm   19M Sep 11  2016 access.log.34.gz
    -rw-r----- 1 root adm   15M Sep  4  2016 access.log.35.gz
    -rw-r----- 1 root adm   19M Aug 29  2016 access.log.36.gz
    -rw-r----- 1 root adm   16M Aug 21  2016 access.log.37.gz
    -rw-r----- 1 root adm   16M Aug 14  2016 access.log.38.gz
    -rw-r----- 1 root adm   21M Aug  8  2016 access.log.39.gz
    -rw-r----- 1 root adm   24M Apr 16 06:39 access.log.3.gz
    -rw-r----- 1 root adm   20M Jul 31  2016 access.log.40.gz
    -rw-r----- 1 root adm   19M Jul 24  2016 access.log.41.gz
    -rw-r----- 1 root adm   16M Jul 17  2016 access.log.42.gz
    -rw-r----- 1 root adm   20M Jul 11  2016 access.log.43.gz
    -rw-r----- 1 root adm   20M Jul  3  2016 access.log.44.gz
    -rw-r----- 1 root adm   19M Jun 26  2016 access.log.45.gz
    -rw-r----- 1 root adm   24M Jun 20  2016 access.log.46.gz
    -rw-r----- 1 root adm   20M Jun 12  2016 access.log.47.gz
    -rw-r----- 1 root adm   19M Jun  5  2016 access.log.48.gz
    -rw-r----- 1 root adm   23M May 30  2016 access.log.49.gz
    -rw-r----- 1 root adm   19M Apr  9 06:37 access.log.4.gz
    -rw-r----- 1 root adm   18M May 22  2016 access.log.50.gz
    -rw-r----- 1 root adm   30M May 16  2016 access.log.51.gz
    -rw-r----- 1 root adm   24M May  8  2016 access.log.52.gz
    -rw-r----- 1 root adm   28M Apr  3 06:39 access.log.5.gz
    -rw-r----- 1 root adm   26M Mar 26 06:50 access.log.6.gz
    -rw-r----- 1 root adm   21M Mar 19 06:39 access.log.7.gz
    -rw-r----- 1 root adm   27M Mar 13 06:54 access.log.8.gz
    -rw-r----- 1 root adm   23M Mar  5 06:55 access.log.9.gz
    -rw-r----- 1 root adm   27M Mar 24  2016 access.log.save
    -rw-r----- 1 root adm  114K Apr 30 11:06 error.log
    -rw-r----- 1 root adm  9.8M Apr 30 06:55 error.log.1
    -rw-r----- 1 root adm 1018K Feb 27 06:44 error.log.10.gz
    -rw-r----- 1 root adm  7.3M Feb 19 06:53 error.log.11.gz
    -rw-r----- 1 root adm  2.1M Feb 13 06:49 error.log.12.gz
    -rw-r----- 1 root adm  2.2M Feb  5 06:34 error.log.13.gz
    -rw-r----- 1 root adm  2.8M Jan 30 06:52 error.log.14.gz
    -rw-r----- 1 root adm  1.8M Jan 22 06:43 error.log.15.gz
    -rw-r----- 1 root adm  2.2M Jan 16 06:45 error.log.16.gz
    -rw-r----- 1 root adm  2.2M Jan  8 06:51 error.log.17.gz
    -rw-r----- 1 root adm  3.0M Jan  2 06:55 error.log.18.gz
    -rw-r----- 1 root adm  2.5M Dec 25 06:53 error.log.19.gz
    -rw-r----- 1 root adm   16K Dec 20 06:53 error.log.20.gz
    -rw-r----- 1 root adm  4.0M Dec 20 05:48 error.log.21.gz
    -rw-r----- 1 root adm  2.3M Dec  5 06:30 error.log.22.gz
    -rw-r----- 1 root adm  2.0M Nov 27 06:46 error.log.23.gz
    -rw-r----- 1 root adm  1.9M Nov 20 06:38 error.log.24.gz
    -rw-r----- 1 root adm  3.1M Nov 14 06:39 error.log.25.gz
    -rw-r----- 1 root adm  2.1M Nov  6 06:53 error.log.26.gz
    -rw-r----- 1 root adm  4.7M Oct 30 06:37 error.log.27.gz
    -rw-r----- 1 root adm  3.0M Oct 24  2016 error.log.28.gz
    -rw-r----- 1 root adm  2.3M Oct 16  2016 error.log.29.gz
    -rw-r----- 1 root adm  1.1M Apr 23 06:41 error.log.2.gz
    -rw-r----- 1 root adm  2.2M Oct  9  2016 error.log.30.gz
    -rw-r----- 1 root adm  2.7M Oct  3  2016 error.log.31.gz
    -rw-r----- 1 root adm  3.0M Sep 25  2016 error.log.32.gz
    -rw-r----- 1 root adm  3.1M Sep 19  2016 error.log.33.gz
    -rw-r----- 1 root adm  2.4M Sep 11  2016 error.log.34.gz
    -rw-r----- 1 root adm  2.9M Sep  4  2016 error.log.35.gz
    -rw-r----- 1 root adm  2.9M Aug 29  2016 error.log.36.gz
    -rw-r----- 1 root adm  2.6M Aug 21  2016 error.log.37.gz
    -rw-r----- 1 root adm  2.6M Aug 14  2016 error.log.38.gz
    -rw-r----- 1 root adm  4.1M Aug  8  2016 error.log.39.gz
    -rw-r----- 1 root adm  978K Apr 16 06:38 error.log.3.gz
    -rw-r----- 1 root adm  3.2M Jul 31  2016 error.log.40.gz
    -rw-r----- 1 root adm  3.6M Jul 24  2016 error.log.41.gz
    -rw-r----- 1 root adm  3.9M Jul 17  2016 error.log.42.gz
    -rw-r----- 1 root adm  4.0M Jul 11  2016 error.log.43.gz
    -rw-r----- 1 root adm  3.8M Jul  3  2016 error.log.44.gz
    -rw-r----- 1 root adm  5.0M Jun 26  2016 error.log.45.gz
    -rw-r----- 1 root adm  4.8M Jun 20  2016 error.log.46.gz
    -rw-r----- 1 root adm  3.4M Jun 12  2016 error.log.47.gz
    -rw-r----- 1 root adm  4.1M Jun  5  2016 error.log.48.gz
    -rw-r----- 1 root adm  3.8M May 30  2016 error.log.49.gz
    -rw-r----- 1 root adm  400K Apr  9 06:37 error.log.4.gz
    -rw-r----- 1 root adm  3.7M May 22  2016 error.log.50.gz
    -rw-r----- 1 root adm  3.5M May 16  2016 error.log.51.gz
    -rw-r----- 1 root adm  2.3M May  8  2016 error.log.52.gz
    -rw-r----- 1 root adm  407K Apr  3 06:39 error.log.5.gz
    -rw-r----- 1 root adm  328K Mar 26 06:50 error.log.6.gz
    -rw-r----- 1 root adm  333K Mar 19 06:37 error.log.7.gz
    -rw-r----- 1 root adm  355K Mar 13 06:53 error.log.8.gz
    -rw-r----- 1 root adm  3.8M Mar  5 06:55 error.log.9.gz
    -rw-r----- 1 root adm     0 Mar 13  2016 other_vhosts_access.log
    
    • OUTPUT for tail -50 /var/log/apache2/error.log

      [Sun Apr 30 10:49:19.149135 2017] [access_compat:error] [pid 8133] [client 188.230.244.237:58697] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:50:02.027352 2017] [access_compat:error] [pid 8170] [client 162.158.179.80:12336] AH01797: client denied by server configuration: /var/www/site2.us/xmlrpc.php, referer: http://site2.us
      [Sun Apr 30 10:51:00.972044 2017] [access_compat:error] [pid 8114] [client 197.28.74.129:13660] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:51:11.021840 2017] [access_compat:error] [pid 8130] [client 103.226.84.202:62906] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:51:11.219070 2017] [access_compat:error] [pid 8179] [client 151.80.230.141:54502] AH01797: client denied by server configuration: /var/www/site5.it/xmlrpc.php
      [Sun Apr 30 10:51:15.027613 2017] [access_compat:error] [pid 8172] [client 41.42.203.48:65476] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:51:26.420182 2017] [access_compat:error] [pid 8126] [client 165.231.105.172:52253] AH01797: client denied by server configuration: /var/www/site5.it/xmlrpc.php, referer: http://www.site5.it
      [Sun Apr 30 10:52:17.342582 2017] [access_compat:error] [pid 8146] [client 162.158.179.128:14739] AH01797: client denied by server configuration: /var/www/site3.com/xmlrpc.php, referer: http://www.site3.com
      [Sun Apr 30 10:52:31.889028 2017] [:error] [pid 8077] [client 172.68.58.111:32498] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site6.com/model/yd-360s3/
      [Sun Apr 30 10:53:23.518610 2017] [:error] [pid 8211] [client 66.249.64.107:65220] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site9.org/studio/jabra/page/11/?orderby=menu_order
      [Sun Apr 30 10:53:23.644713 2017] [:error] [pid 8211] [client 66.249.64.107:65220] The woocommerce_clean function is deprecated since version 3.0. Replace with wc_clean., referer: http://site9.org/studio/jabra/page/11/?orderby=menu_order
      [Sun Apr 30 10:53:59.268023 2017] [:error] [pid 8179] [client 66.249.64.107:54085] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site9.org/studio/jabra/page/16/
      [Sun Apr 30 10:54:40.342824 2017] [access_compat:error] [pid 8137] [client 213.111.217.155:54234] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:54:43.872470 2017] [access_compat:error] [pid 8137] [client 108.162.219.146:14626] AH01797: client denied by server configuration: /var/www/site3.com/xmlrpc.php, referer: http://www.site3.com
      [Sun Apr 30 10:55:06.561780 2017] [access_compat:error] [pid 8190] [client 108.162.219.92:19407] AH01797: client denied by server configuration: /var/www/site4.com/xmlrpc.php, referer: http://site4.com
      [Sun Apr 30 10:55:36.974314 2017] [access_compat:error] [pid 8264] [client 162.158.88.186:15649] AH01797: client denied by server configuration: /var/www/site3.com/xmlrpc.php, referer: http://www.site3.com
      [Sun Apr 30 10:55:38.967155 2017] [access_compat:error] [pid 8167] [client 108.162.219.14:19006] AH01797: client denied by server configuration: /var/www/site3.com/xmlrpc.php, referer: http://www.site3.com
      [Sun Apr 30 10:56:33.778953 2017] [access_compat:error] [pid 8270] [client 86.125.9.194:53171] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:56:42.927537 2017] [access_compat:error] [pid 8245] [client 79.178.138.224:25229] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:56:48.256099 2017] [:error] [pid 8249] [client 108.162.216.188:30926] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site6.com/partnumber/14r1j/
      [Sun Apr 30 10:57:57.140601 2017] [access_compat:error] [pid 8327] [client 173.245.53.68:22349] AH01797: client denied by server configuration: /var/www/site4.com/xmlrpc.php, referer: http://site4.com/
      [Sun Apr 30 10:57:59.910486 2017] [access_compat:error] [pid 8270] [client 202.142.104.27:49011] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:58:14.846611 2017] [access_compat:error] [pid 8328] [client 162.158.167.136:9843] AH01797: client denied by server configuration: /var/www/site8.com/xmlrpc.php, referer: http://site8.com
      [Sun Apr 30 10:59:02.955034 2017] [access_compat:error] [pid 8362] [client 73.228.30.237:49396] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:59:19.743059 2017] [access_compat:error] [pid 8342] [client 82.199.204.150:55827] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:59:39.018988 2017] [access_compat:error] [pid 8359] [client 84.127.65.117:58386] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 10:59:53.870343 2017] [access_compat:error] [pid 8343] [client 202.112.30.131:53215] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:00:24.832143 2017] [access_compat:error] [pid 8324] [client 77.139.9.142:49517] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:00:32.058648 2017] [access_compat:error] [pid 8364] [client 59.88.85.114:60899] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:00:53.043260 2017] [access_compat:error] [pid 8414] [client 108.162.222.206:27107] AH01797: client denied by server configuration: /var/www/site4.com/xmlrpc.php, referer: http://site4.com
      [Sun Apr 30 11:00:59.201951 2017] [access_compat:error] [pid 8436] [client 87.218.123.71:61932] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:01:31.781524 2017] [:error] [pid 8467] [client 162.158.75.110:11974] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site6.com/size/18-inch-overall/?orderby=price
      [Sun Apr 30 11:01:32.020650 2017] [:error] [pid 8467] [client 162.158.75.110:11974] The woocommerce_clean function is deprecated since version 3.0. Replace with wc_clean., referer: http://site6.com/size/18-inch-overall/?orderby=price
      [Sun Apr 30 11:01:44.953194 2017] [access_compat:error] [pid 8343] [client 172.68.25.200:15402] AH01797: client denied by server configuration: /var/www/site4.com/xmlrpc.php, referer: http://site4.com
      [Sun Apr 30 11:01:48.228338 2017] [access_compat:error] [pid 8414] [client 109.175.113.242:57404] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:01:56.693193 2017] [:error] [pid 8452] [client 188.114.102.134:15544] The The "add_to_cart_fragments" hook uses out of date data structures and function is deprecated since version 3.0.5. Replace with woocommerce_add_to_cart_fragments., referer: http://site4.com/capsule-ricaricabili-e-caricabili-per-caffe-guida-completa-allacquisto/
      [Sun Apr 30 11:01:59.080691 2017] [access_compat:error] [pid 8446] [client 123.200.4.26:62037] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:02:10.835035 2017] [:error] [pid 8484] [client 162.158.75.140:16677] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site6.com/partnumber/mx-a800rd/
      [Sun Apr 30 11:02:25.057568 2017] [access_compat:error] [pid 8484] [client 86.123.243.202:61471] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:03:49.097921 2017] [:error] [pid 8485] [client 162.158.75.164:37177] The woocommerce_get_page_id function is deprecated since version 3.0. Replace with wc_get_page_id., referer: http://site6.com/releasedate/2010-08-11/page/4/
      [Sun Apr 30 11:03:59.716354 2017] [access_compat:error] [pid 8520] [client 162.158.69.193:25651] AH01797: client denied by server configuration: /var/www/site2.us/xmlrpc.php, referer: http://site2.us
      [Sun Apr 30 11:04:04.178992 2017] [:error] [pid 8427] [client 162.158.90.22:14537] script '/var/www/html/wp-login.php' not found or unable to stat, referer: http://site7.com/wp-login.php
      [Sun Apr 30 11:04:04.448617 2017] [:error] [pid 8518] [client 162.158.90.22:31742] script '/var/www/html/wp-login.php' not found or unable to stat, referer: http://site7.com/wp-login.php
      [Sun Apr 30 11:04:35.852001 2017] [access_compat:error] [pid 8526] [client 178.151.133.62:63532] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:04:36.509904 2017] [access_compat:error] [pid 8436] [client 103.16.209.6:58512] AH01797: client denied by server configuration: /var/www/site5.it/xmlrpc.php, referer: http://www.site5.it
      [Sun Apr 30 11:05:31.613860 2017] [access_compat:error] [pid 8436] [client 103.60.175.31:62090] AH01797: client denied by server configuration: /var/www/site1.it/xmlrpc.php
      [Sun Apr 30 11:06:09.574432 2017] [access_compat:error] [pid 8436] [client 162.158.92.182:21453] AH01797: client denied by server configuration: /var/www/site2.us/xmlrpc.php, referer: http://site2.us
      [Sun Apr 30 11:08:40.295834 2017] [access_compat:error] [pid 8308] [client 108.162.222.92:10584] AH01797: client denied by server configuration: /var/www/site2.us/xmlrpc.php, referer: http://site2.us
      [Sun Apr 30 11:08:50.431893 2017] [access_compat:error] [pid 8827] [client 162.158.90.88:31116] AH01797: client denied by server configuration: /var/www/site4.com/xmlrpc.php, referer: http://site4.com
      [Sun Apr 30 11:09:15.972000 2017] [access_compat:error] [pid 8640] [client 202.80.212.184:32157] AH01797: client denied by server configuration: /var/www/site5.it/xmlrpc.php, referer: http://www.site5.it
      
      
      

@Stew

I expected to see more specific errors, but it looks okay in general. The reason I wanted to see the list of log files, was because sometimes Apache behaves in a strange way, if the log files grow to a very big size.

One thing I'm noticing, some of the sites are running WooCommerce, which is a very heavy WordPress plugin, so if you are running multiple WordPress sites and some of them using WooCommerce, then you might actually run out of RAM.

But it's still weird that it didn't make any difference, when you removed a couple of sites.
Let's see we can get some expert assistance.

@jtittle Have you seen this before? Apache using all memory with multiple WordPress+WooCommerce. You know what my off-the-bat recommendation would be.

@Stew @hansen

From looking at error.log output, the client denied by server configuration error is probably due to VirtualHost blocks not having a <Directory ...> block setup to allow the request through.

Apache differs from NGINX in that you have to allow access to directories instead of restrict access.

If you intentionally restricting access to that file, since it seems to be repetitive, then you may have a correct setup and the errors are just logging that access was denied. I'd have to see the VirtualHost blocks to really make that call, as well as your .htaccess file(s) -- for each site.

...

As for the RAM usage, restarting the server will normally always brings things back online as you're flushing everything when you do that. Everything starts from square one all over, resource usage begins to creep up, and then you're back in the same situation.

The issue here, beyond the above errors, seems to be a matter of WordPress + WooCommerce, plus from what I can gather from the log, around 9 websites.

...

If each of those 9 sites are WordPress + WooCommerce:

1). 2GB of RAM most likely isn't enough. WooCommerce is a heavy plugin and normally, in my past dealings with it, needs at least 1GB per instance (WordPress + WooCommerce).

2). Beyond RAM, you need to look in to optimizing your stack. This includes optimizing Apache, PHP, MySQL, etc. Default configurations are only starting points, they are not meant for production, so if you've not tweaked/tuned your stack, it's not going to perform as well as it could/should. If you're not able to do this yourself, I'd definitely recommend hiring a sysadmin (hey....I'm available :-)).

3). Beyond the first two, the hint that @hansen dropped would be dropping Apache in favor of NGINX as your web server, which I'd honestly recommend as well. It's more performant and would likely reduce some of the RAM consumption alone, though you'd still need to look in to optimizing your stack for better performance and resource usage.

...

You can take the easy route and throw hardware at it (i.e upgrade to 4GB or 8GB), but you'll soon be back with the same issue as throwing hardware at it only works for so long. Part of running a sever is optimization or hiring a sysadmin to do it for you. Beyond that, maintaining security, server updates, and perhaps most important, since it seems your current version is out of date, keeping WordPress and WooCommerce up to date as well.

  • Ok thank you, i will consider your professional help, but i want know why ram consuption incrased in the last 3/4 week, before all my sites working very well, with 14 sites.

    definitely your tips for me is swith tu Ubuntu 16 on NGINX?

    • @Stew

      Without knowing more about each site, such as traffic levels, plugins installed, whether every site is updated (WordPress, WooCommerce, Plugins), whether it's properly secured and blocking potential connections on various ports that don't need to be open, properly tuned and/or optimized, misconfigured etc -- it's really hard to say why resource usage has increased.

      A few potential scenarios may be that traffic has increased, if the error in the logs isn't of your doing (i.e. you're blocking access to that file), then it's possible someone is attempting to attack your site in hopes of being able to break in (making upgrading even more important), etc.

      ...

      The majority of WordPress sites need at least 256MB of RAM (that's for PHP, not Apache or MySQL -- that'd be separate) when it comes to WordPress + WooCommerce or WordPress and numerous plugins.

      If you're hosting 14 sites, that comes out to 3.5GB RAM. If we add Apache overhead and the RAM needed by MySQL and the service itself, I'd say your probably closer to needing 4-4.5GB of RAM, at minimum.

      You may not use it 100% of the time, but that's a general estimate.

Have another answer? Share your knowledge.