Page 1 of 1

Performance Tuning Question(s)

Posted: Fri Jul 06, 2018 9:39 pm
by edgeinteractive
I am looking for some means to improve performance. I have tuned the SQL database with an extension that creates indexes that took refresh time from 90 seconds to 10-15 seconds. I also Tuned the MYSQL which helps. I am running OpenCart 3, on an 8GB, 8Core machine with Apache. 2.4.x. w/php 5.6. (CENTOS7). I created 3GB of Swap space but that did not have any effect.

I am not seeing any real bottlenecks with IOSTAT or VMSTAT. I just see slow responses with searches and specifically creating sitemap.xml or other SEO based URLs.

What I would like to know, is a bigger server in order (bigger processor and more memory)? I am looking at upgrading the processor and memory (16GB). I suspect the issue is most likely with PHP tuning.

Does anyone have suggestions on how to improve performance?

Re: Performance Tuning Question(s)

Posted: Fri Jul 06, 2018 9:52 pm
by straightlight
What I would like to know, is a bigger server in order (bigger processor and more memory)? I am looking at upgrading the processor and memory (16GB). I suspect the issue is most likely with PHP tuning.
Upgrading to PHP v7.1 would help optimizing PHP queries. An additional way would be by monitoring your server running tasks from SSH noticing what might be using so many resources in order for you to consider the next best plan of action afterwards.

Re: Performance Tuning Question(s)

Posted: Fri Jul 06, 2018 10:19 pm
by OSWorX
straightlight wrote:
Fri Jul 06, 2018 9:52 pm
Upgrading to PHP v7.1 would help optimizing PHP queries.
Or better 7.2.x - running my sites with that, gives them a boost of 5-15% compared to 7.1.
And 35-45% compared to 5.x

And if you really need (and want), some sql-queries could be optimized . but for that, search this forum - guess I have seen some threads for doing that.

Re: Performance Tuning Question(s)

Posted: Fri Jul 06, 2018 10:21 pm
by straightlight
OSWorX wrote:
Fri Jul 06, 2018 10:19 pm
straightlight wrote:
Fri Jul 06, 2018 9:52 pm
Upgrading to PHP v7.1 would help optimizing PHP queries.
Or better 7.2.x - running my sites with that, gives them a boost of 5-15% compared to 7.1.
And 35-45% compared to 5.x

And if you really need (and want), some sql-queries could be optimized . but for that, search this forum - guess I have seen some threads for doing that.
I also demonstrated the point of view yesterday regarding PHP v7.2. However, it seem there are other site of views regarding that PHP version when using Opencart particularly for some reason: viewtopic.php?f=10&t=205504#p728337

Re: Performance Tuning Question(s)

Posted: Fri Jul 06, 2018 11:17 pm
by OSWorX
Using 7.2 may result in updating the encryption library > update / rework requried
Also some messages / notices like: A non-numeric value encountered (at several places) > 'only' a notice

That is all what I can remember right now.
As said: running currently several 2.1.0.2, 2.2.x and 2.3.0.2 client shops > see library update (made by my our own)
And here a fix from this forum: viewtopic.php?t=199924#p722648

3.0.2.0 and 3.1.x alpha as test > no interaction (3.0.2.0 was something I do not remember anymore ..)

If error output is enabled, the notices about the non-numeric values are nasty, but not stopping the shop from work.

And 1 comparison: https://www.phoronix.com/scan.php?page= ... -Benchmark

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 12:34 am
by straightlight
No longer an issue with the Encryption library, I have already posted a solution for this sometime ago: viewtopic.php?f=198&t=204707&p=725370#p725077 . It seem with your above pointed topics as well, this current topic may become important to point out to future users regarding these requests.

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 4:42 am
by IP_CAM
OSWorX wrote: Upgrading to PHP v7.1 would help optimizing PHP queries.Or better 7.2.x - running my sites with that, gives them a boost of 5-15% compared to 7.1. And 35-45% compared to 5.x
Well, that might be the Case, in your Case :D , but according to my latest tests, output-performance-wise,
I just don't see a real difference, by testing with 4 different PHP Versions. (image only shows 3 of them!)
In contrary, the images even may leave a different impression. ::)
But that's, what finally counts, I assume, for 'regular Users' at least, many other Improvements are of
much more importance, to make a Shop run top, strictly from the Performance point of View, I guess.
---
OSWorX wrote: the notices about the non-numeric values are nasty...
They really are, but for an unknown yet reason, in my Bigmax TestShop, I did not run into
any of them yet. Contrary to the other OC-2 styled Sites I use, with the PHP v.7.2.x. But since
it's not an OC-2 type Bootstrap Theme on that Site, but based on the lovely Merkent Theme
Extension, wich works, in part, a little different from default OC, I cannot be sure
yet, where those nasty messages originate from. But I also have a hand full of slightly different
coded PHP-7 encryption.php files also, so, I will have to find out first, wich one really matches
best for my Version used. Just to have it mentioned... ;)
Ernie
---
Image-link, it's to big to show here in full.
download/file.php?mode=view&id=35096
---

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 12:45 pm
by OSWorX
IP_CAM wrote:
Sat Jul 07, 2018 4:42 am
OSWorX wrote: the notices about the non-numeric values are nasty...
They really are, but for an unknown yet reason ..
But I know, simply read: http://php.net/manual/de/migration71.other-changes.php

Means, if you have an OC based store, and not disabled any error reporting (!), you will see many messages .. (or at least in the error.log)
And, error reporting depends also how it is set in your php.ini: http://php.net/manual/de/function.error-reporting.php

But before editing some server vars (e.g. php.ini) which most of the users are not allowed to do, add this to your index.php:

Code: Select all

error_reporting( E_ALL );
ini_set( 'error_reporting', E_ALL );
ini_set( 'display_errors', 'On' );
and you will be suprised what can be seen now ..

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 7:51 pm
by straightlight
The session ID regeneration might be a good subject to cover on GitHub in the mean time when using PHP v7.1 or above regarding the referred topic on the above since this guide originates from PHP officials.

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 8:47 pm
by IP_CAM
Well, I did it, as shown below. But I can only test it tonight, after I come back from the club.
Meanwhile, I hope, that some will make a few tests ! :D
Ernie
http://www.bigmax.ch/shop/index.php?route=common/home

Code: Select all

<?php
// Version
define('VERSION', '1.5.6.5');

error_reporting( E_ALL );
ini_set( 'error_reporting', E_ALL );
ini_set( 'display_errors', 'On' );

// Configuration
if (file_exists('config.php')) {
	require_once('config.php');

Re: Performance Tuning Question(s)

Posted: Sat Jul 07, 2018 9:26 pm
by straightlight
if (file_exists('config.php')) {
require_once('config.php');
Would cause: Unexpected end of: } .

Re: Performance Tuning Question(s)

Posted: Sun Jul 08, 2018 8:03 am
by IP_CAM
if (file_exists('config.php')) { require_once('config.php');
Well, that } exists, I did just not print it out here, in a hurry, to go ... ;)
But I am starting my 73rd year of existence, just today, so, please be kind... :crazy:
---
Still, I don't see errors or warnings in any of my logs, so, I guess, it works as
planned, after finding a remarkable jump on Site Access during the past few hours.
But since I mostly use the same ~100 VqMod's and some Ext. Modules as on the other
Sites, I really start to wonder, if my Merkent Theme Extension might be related to this,
since on all other Testsites, where OC2-styled Themes are used, as well as the default
OC 'way' of building Listing-Pages, the PHP v.7.2.x 'Countable' problem seems to exist.
Since this is the only real difference, compared to the other sites, as I can think of,
momentarely. 8) But I will find out , I assume ... :D
Ernie
---
Image shows the Merkent way of building Listing Pages, It assures, to always have a perfect
equal Layout, regardless of the Listing displayed (Bestseller/Special/Favourites/Latest/e.t.c.),
and changes only have to be made in one single file, to make it work globally. It's a great Idea too,
but unfortunately no longer OC pure... 8) Still, it does not have to be used, default still applies!
---
Image
---
http://merkent.com/merkent_theme_v3
---

Re: Performance Tuning Question(s)

Posted: Mon Jul 09, 2018 7:33 am
by IP_CAM
Well, in my Case, Peku's OC2 to 1.5.6 Theme + OC Edge use a file, named
catalog/model/module/module.php, and it happen, by trying to
list/count Modules, and/or set Responsive view Specials/Latest/etc.,
on Line 16 of the module.php Page Code:
if(count($array[0]) > 0 && is_array($array)){
PHP 7.2.x presents it's unfamous PHP Warning. So, I will contact Peku
on this, he might know a solution on this Counting matter. :D
Ernie

Re: Performance Tuning Question(s)

Posted: Mon Jul 09, 2018 2:08 pm
by OSWorX
IP_CAM wrote:
Mon Jul 09, 2018 7:33 am
Well, in my Case, Peku's OC2 to 1.5.6 Theme + OC Edge use a file, named
catalog/model/module/module.php, and it happen, by trying to
list/count Modules, and/or set Responsive view Specials/Latest/etc.,
on Line 16 of the module.php Page Code:
if(count($array[0]) > 0 && is_array($array)){
PHP 7.2.x presents it's unfamous PHP Warning. So, I will contact Peku
on this, he might know a solution on this Counting matter. :D
Ernie
Well, counting an array before checking if it is an array makes no sense.

Re: Performance Tuning Question(s)

Posted: Tue Jul 10, 2018 8:57 pm
by MrPhil
OSWorX wrote:
Mon Jul 09, 2018 2:08 pm

Code: Select all

if (count($array[0]) > 0 && is_array($array)) { ...
Well, counting an array before checking if it is an array makes no sense.
Try rearranging the order, so it won't try count()ing before it's confirmed that it's an array:

Code: Select all

if (is_array($array) && count($array[0]) > 0) { ...
It's called "short circuiting" the logical expression.

Re: Performance Tuning Question(s)

Posted: Wed Jul 11, 2018 1:14 am
by IP_CAM
if (is_array($array) && count($array[0]) > 0) { ...
Life could be so easy, if I would only be Coder, but unfortunately, I am not. ::)
Thanks a Lot, it really seems to work now with php v.7.2.7 and Peku's
OC-2 to 1.5 Theme related Custom Code as well. :D
I am so happy ... :-*
Ernie
PS. this test site still has a few other minor misses, not related to PHP7, but
it only serves, to test new Mods, but not, to later be used in real ...
---
Image
---

Re: Performance Tuning Question(s)

Posted: Sun Jul 22, 2018 10:51 pm
by Daniel
error reporting can be turned off from system/config/default.php

Re: Performance Tuning Question(s)

Posted: Sun Jul 22, 2018 11:51 pm
by OSWorX
Daniel wrote:
Sun Jul 22, 2018 10:51 pm
error reporting can be turned off from system/config/default.php
Well, there (2.x, 3.0.x, 3.1.x) is only that:

Code: Select all

// Error
$_['error_display']        = true;
$_['error_log']            = true;
$_['error_filename']       = 'error.log';
Or have you added more?

Re: Category Cache Data - Performance Tuning Question(s)

Posted: Mon Jul 23, 2018 3:26 am
by IP_CAM
The OcMod Version of WeismannWeb's free Cache Categories Data VqMod
has been finalized + confirmed by OSWorX, to function in default OC v.3.0.2.x:
viewtopic.php?f=202&t=203186&p=729781#p729781
Good Luck !
Ernie