Jump to content

PS server memory leak / crashing


jon-sh

Recommended Posts

We had 8 hours of downtime overnight after the server crashed due to memory limits.

The site is hosted on a high performance VPS (cPanel/Centos6 with 2 CPU cores and 4GB RAM), with no other websites hosted there. Whilst it is relatively low traffic, orders come in regularly. However at random times suddenly memory usage goes crazy, so much so the server runs out of memory and OOM Killer is invoked. That is pretty much all we can find from logs etc, OOM Killer trying to kill PHP processes. On one of the times we were logged in the Admin backend processing some orders (pretty standard stuff) and this happened, other times we weren't doing anything at all (eg like at 2am).

The administrators confirm there were no issues on the kvmhost the VPS is hosted on at the time, and they've gone through all the logs on the VPS they can think of...

  • (1) Apache access logs shows little activity before the crash,
  • (2) same with the servers "messages" log,
  • (3) network traffic doesn't spike 
  • (4) WHM's 'daily process log' doesn't show anything particularly suspicious.
  • (5) No crons were being ran at the time,
  • (6) no backups taking place
  • (7) Everytime we check on the server the load average is 0.x, memory usage is low, and no lingering MySQL queries - however we've yet to be checking and 'catch it in action'.
  • (8) php.ini has 512M memory limits (for both /root and /adminxxxxxx directories)

 

We need to figure out why suddenly Prestashop starts consuming so much memory and continues to do so randomly. The version of Prestashop is 1.7.2.3 and the version of PHP currently being used is 5.5.25.

Is there any Caching process that runs automatically and uses up all the memory?

Edited by jon-sh (see edit history)
Link to comment
Share on other sites

Hi @jon-sh

You seamed to have tested lot of things already and I do not have at moment any suggestion. 

But one thing I notice, you said PHP is 5.5.25, why that and not some PHP 7 version, 7.0 or 7.1 ?

Also you could try on test/dev site to update to latest 1.7.3.2 and see if that helps.  Note like any update

do take backups and test all on things before running update on production site.

Link to comment
Share on other sites

I haven't updated PHP yet as I am waiting for PS 1.7.4 release date so I can do one major update along with PHP 7.2. 

So far every update of PS 1.7.x.x has been problematic and a waste of time having to manually fix and roll back files, broken installs + other misc issues, hence why we are staying on 1.7.2.3 for the time being.

PS 1.7 has been a headache from the beginning so I am hoping 1.7.4 will be the version that finally brings me some peace of mind...

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

 I am having this issue, pretashop 1.7.3, VPS 4gb, php 7.

The issue started as soon as I deleted a  category. I also got server 500 on front end (admin was fine). Debug mode provided no info and there were no errors in logs (admin also).

The only way to get it back was to drop the tables and re-import from a backup. The process was affecting my entire VPN, a large number of sites.

[root@.. shop]# tail error_log [07-Jun-2018 18:16:16 ] PHP Fatal error: Out of memory (allocated 4042842112) (tried to allocate 3433041920 bytes) in /home/../classes/exception/PrestaShopException.php on line 140

[07-Jun-2018 18:16:16] PHP Fatal error: Out of memory (allocated 4042842112) (tried to allocate 3433041920 bytes) in /home/../vendor/symfony/symfony/src/Symfony/Component/Debug/ExceptionHandler.php on line 197

[07-Jun-2018 18:16:16 ] PHP Fatal error: Out of memory (allocated 4042842112) (tried to allocate 4009287680 bytes) in Unknown on line 0

 

[root@.. public_html]# mysqladmin proc stat +-----+------------+-----------------+----------------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-----+------------+-----------------+----------------+---------+------+-------+------------------+ | 522 | .. | localhost:34796 | .. | Sleep | 87 | | | | 525 | root | localhost | | Query | 0 | init | show processlist | +-----+------------+-----------------+----------------+---------+------+-------+------------------+ Uptime: 5493 Threads: 2 Questions: 69333 Slow queries: 0 Opens: 962 Flush tables: 1 Open tables: 887 Queries per second avg: 12.622

[root@.. shop]# tail error_logcond avg: 12.622

 

Note: re the sql you may notice there a mysql query sleeping during the loading of the page before the errors are shown by way of blank page, timing out at 87 seconds.

Therefore, coding should be looked at by the devs.

Edited by jetx (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

An update to this, the bug appears to be caused by a module (mega menu from sunnytoo themes), so when a category is deleted (not all but some).

 

*ERROR*     v1.7.3.3    2018/06/18 - 09:28:55: Invalid category vars at line 374 in file classes/Link.php

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...