1

This is on a unmanaged dedicated webserver used to run

  • Opencart 2.3.0.2
  • PHP 7.1
  • Server specs:
  • Xenon 2.13Ghz 8 Core 32GB RAM
  • CentOS 7.8
  • WHM v86.0.18

Web Traffic stats from Cloudflare

The traffic looks like I am being being DDOS'd, although it has never been quite this bad. In terms of server resources. I'm thinking there may be something broken in Opencart that is causing it to use so much CPU. All login forms are protected with v2 recaptcha.

Here's a trace from a php-fpm process that is running 59% CPU usage. https://pastebin.com/ALdhfHMN

Pid                     Owner             Prty   CPU%   Memory %                  Command
23849 (Trace) (Kill)    ocstorecpaneluser   0     73.91 0.42    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23848 (Trace) (Kill)    ocstorecpaneluser   0     64.41 0.35    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23847 (Trace) (Kill)    ocstorecpaneluser   0     60.66 0.46    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
2386 (Trace) (Kill)     mysql               0     53.08 0.69  /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
23846 (Trace) (Kill)    ocstorecpaneluser   0     41.38 0.38    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23842 (Trace) (Kill)    ocstorecpaneluser   0     35.07 0.41    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23841 (Trace) (Kill)    ocstorecpaneluser   0     30.72 0.40    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23840 (Trace) (Kill)    ocstorecpaneluser   0     28.83 0.37    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23835 (Trace) (Kill)    ocstorecpaneluser   0     25.85 0.37    /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23833 (Trace) (Kill)    ocstorecpaneluser   0     25.62 0.51  /opt/cpanel/ea-php71/root/usr/bin/php-cgi
23829 (Trace) (Kill)    ocstorecpaneluser   0     25.48 0.54  /opt/cpanel/ea-php71/root/usr/bin/php-cgi

Included in the same pastebin are the TOP processes and the current SQL processes.

Where does one start in figuring out why this PHP-FPM would have such high resource usage?

I have tried lowering the limits in php.ini for the opencart folder, but it didn't seem to make much of a difference, and I'm not sure what settings are optimal for opencart as I was unable to find a recommended settings example anywhere.

I have also tried blocking traffic to the server entirely, which does fix the problem, but doesn't tell me anymore than that the high usage is happening when there are multiple users on the site.

Giacomo1968
  • 58,727

1 Answers1

0

Solved the problem thanks to some help from the OC forum.

It was a poorly written extension for OC that was causing the problem. Went through and disabled it and everything cleared up.

To track this down, a forum member suggested setting php.ini memory_limit to as low as it could possibly be within opencart. I quickly discovered that OC wouldn't even load a page with less than 250M. This isn't right, OC should run with really really low memory.

After discovering that it could not run with low memory, the next likely culprit was VQMOD or a plugin. VQMod was not the issue, and I by chance was able to find the culprit rather quickly after encountering a SQL error related to the extension that was causing the problem.