Page 1 of 1

[SOLVED] VPS server settings - optimization for high speed

Posted: Sun Feb 07, 2021 5:23 pm
by ideep13
I have now moved to Namescheap VPS Quasar - https://www.namecheap.com/hosting/vps/.
I had to order 2 Tier - cpanel options because I have 2 OC stores, 3 WP stores and 2 blog sites (WP)
4 CPU Cores
6 GB RAM
120 GB SSD RAID 10
3000 GB Bandwidth
As I can see my sites now run even slower as before on Reseller hosting, so I would like to speed up server and sites if this is possible.
Speed Index for 3.0.3.6. store is 5,6 s and for other one who is running on 2.3.0.2. is 5s
Both sites are running through cloudflare (free account)
What is the best PHP-FPM settings for me. Please see screenshot for the system.. and I can change the settings on each individual domain.
I have changed the settings to one of my opencart store https://djecje-kucice.com that is on php 7.4., OC 3.0.3.6. , having unfortunately Journal theme 3 (I have everything on the the theme template regarding performance) The other opencart store is https://staskka.com php 7.3., OC 2.3.0.2 the same theme but 2, not 3
When I tried to change the PHP-FPM settings I received a server monitor error message.
Status Out of Memory ⚠
Memory Information
Used 3.77 GB
Available 2.06 GB
Installed 5.83 GB
“oom_dmesg.txt” I can not add document it doesn't allow me

I set max request 200
Max children 150
Processes 100
for the site 3.0.3.6 but I got memory error so I moved back to default

Can I optimize those sites at all to run it faster? And what is my first step how to optimize a server ?
I have removed exec() for one of the opencart stores, so it suppose to be enabled now.

Where can I see which libraries I have installed (brotli, ect..)?

Re: VPS server settings - optimization for high speed

Posted: Sun Feb 07, 2021 8:02 pm
by khnaz35
First optimise your Database and see if anything change for you. The rest is next step make one change at the time and then see what is impact.

Re: VPS server settings - optimization for high speed

Posted: Sun Feb 07, 2021 10:47 pm
by ideep13
khnaz35 wrote:
Sun Feb 07, 2021 8:02 pm
First optimise your Database and see if anything change for you. The rest is next step make one change at the time and then see what is impact.
Yes I would like to learn this as well - can you advise me how to optimize DB?
IS there a good plugin for this? I found this: https://www.opencart.com/index.php?rout ... ityScripts

Or a good read from the internet by step by step instructions and by providing the link?
This module doesn't work and breaks my site. https://webocreation.com/blog/10-ways-t ... imization/
The size of my DB is 24 MB.
I should have installed this turbo.pho script, but there no documentation so I don't know where to install it, so I rather ran commands in SQL.

Code: Select all

ALTER TABLE `oc_category` ADD INDEX ( `parent_id` ) ;
ALTER TABLE `oc_category` ADD INDEX ( `top` ) ;
ALTER TABLE `oc_category` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `oc_category` ADD INDEX ( `status` ) ;
ALTER TABLE `oc_category_description` ADD INDEX ( `language_id` );
ALTER TABLE `oc_category_to_store` ADD INDEX ( `store_id` );
ALTER TABLE `oc_category_path` ADD INDEX ( `path_id` );
ALTER TABLE `oc_product` ADD INDEX ( `model` ) ;
ALTER TABLE `oc_product` ADD INDEX ( `sku` ) ;
ALTER TABLE `oc_product` ADD INDEX ( `upc` ) ;
ALTER TABLE `oc_product` ADD INDEX ( `manufacturer_id` ) ;
ALTER TABLE `oc_product` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `oc_product` ADD INDEX ( `status` ) ;
ALTER TABLE `oc_product_option` ADD INDEX ( `option_id` ) ;
ALTER TABLE `oc_product_option_value` ADD INDEX ( `product_option_id` ) ;
ALTER TABLE `oc_product_option_value` ADD INDEX ( `product_id` ) ;
ALTER TABLE `oc_product_option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `oc_product_option_value` ADD INDEX ( `option_value_id` ) ;
ALTER TABLE `oc_product_to_category` ADD INDEX ( `category_id` );
ALTER TABLE `oc_product_attribute` ADD INDEX ( `attribute_id` );
ALTER TABLE `oc_product_attribute` ADD INDEX ( `language_id` );
ALTER TABLE `oc_product_description` ADD INDEX ( `language_id` );
ALTER TABLE `oc_product_to_store` ADD INDEX ( `store_id` );
ALTER TABLE `oc_option` ADD INDEX ( `sort_order` ) ;
ALTER TABLE `oc_option_description` ADD INDEX ( `name` ) ;
ALTER TABLE `oc_option_value` ADD INDEX ( `option_id` ) ;
ALTER TABLE `oc_option_value_description` ADD INDEX ( `option_id` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `url_alias_id` );
these 3 doesn't exist in my DB:

Code: Select all

ALTER TABLE `oc_url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `url_alias_id` );
and this is what I got - see screenshot

Re: VPS server settings - optimization for high speed

Posted: Sun Feb 07, 2021 11:07 pm
by xxvirusxx
ideep13 wrote:
Sun Feb 07, 2021 10:47 pm
these 3 doesn't exist in my DB:

Code: Select all

ALTER TABLE `oc_url_alias` ADD INDEX ( `query` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `keyword` ) ;
ALTER TABLE `oc_url_alias` ADD INDEX ( `url_alias_id` );
and this is what I got - see screenshot

Code: Select all

ALTER TABLE `oc_seo_url` ADD INDEX ( `query` ) ;
ALTER TABLE `oc_seo_url` ADD INDEX ( `keyword` ) ;
ALTER TABLE `oc_seo_url` ADD INDEX ( `seo_url_id` );

Re: VPS server settings - optimization for high speed

Posted: Sun Feb 07, 2021 11:16 pm
by ideep13
Thank you I have changed that. MySQL returned empty result.
What else can I do?

Re: VPS server settings - optimization for high speed

Posted: Mon Aug 16, 2021 5:11 am
by lovol2
How you getting on with this?

I am doing the same. Same version and theme... 2.0.3.2 and journal 2.

Now I only know Windows and iis... so moving it to win first. Tried Linux vps 4 core 4gb. And it’s slower than my reseller hosting.

Wazure host takes half the time to download home page according to postman request.... but all my images are broke,,, wish me look. ??? ??? :laugh:

Re: VPS server settings - optimization for high speed

Posted: Mon Aug 16, 2021 5:37 pm
by JNeuhoff
You guys are almost doing everything to slow down your sites:

- Don't use Journal
- Don't use CloudFlare
- Don't use namecheap

Re: VPS server settings - optimization for high speed

Posted: Tue Aug 17, 2021 5:18 pm
by Majnoon
JNeuhoff wrote:
Mon Aug 16, 2021 5:37 pm
You guys are almost doing everything to slow down your sites:

- Don't use Journal
- Don't use CloudFlare
- Don't use namecheap
Don't run the website at all :laugh: :laugh: :laugh:

Re: VPS server settings - optimization for high speed

Posted: Tue Aug 17, 2021 6:38 pm
by straightlight
Majnoon wrote:
Tue Aug 17, 2021 5:18 pm
JNeuhoff wrote:
Mon Aug 16, 2021 5:37 pm
You guys are almost doing everything to slow down your sites:

- Don't use Journal
- Don't use CloudFlare
- Don't use namecheap
Don't run the website at all :laugh: :laugh: :laugh:
Yup, it's getting to that stage.

Re: VPS server settings - optimization for high speed

Posted: Mon Nov 15, 2021 2:21 pm
by ideep13
I would like to reopen this topic again, as I still have problems with the site djecje-kucice.com

We figured out that 500 error was caused because of VQMOD - This topic - viewtopic.php?f=202&t=222464

But there is still something that is causing memory leak..

My site does not work on mobile but rund on desktop.. I turned to hosting and they said this:
Having checked the possible cause, we located:
[14-Nov-2021 11:05:29] WARNING: [pool djecje-kucice_com] server reached max_children setting (5), consider raising it
You can try increasing the max_children limit and tune the PHP-FPM performance as shown in the following guide https://support.cpanel.net/hc/en-us/art ... ing-Basics

Or switch the handler from PHP-FPM to lsapi. This handler does not require additional control of the PHP-FPM pool and takes fewer resources.
Here's a guide if you wish to switch it https://support.cpanel.net/hc/en-us/art ... PI-handler
So I tried to increase the max_children on 10 (on djecje-kucice PHP-FPM settings), but nothing happened..

so I went to the second option to switch to Isapi, but now I get Service Unavailable on mobile for djecje-kucice

How can I found out what is causing this leak and uninstall the shit code (extension or what ever is acusing this) so my site could work proper.

Any help is much apprecaited.

Re: VPS server settings - optimization for high speed

Posted: Tue Nov 16, 2021 2:33 am
by ideep13
we have now found out, that the site is not working only on apple devices.. on desktop the site is working, also on huawei, but not on safari on mobile phones or ipads..

IP is whitelisted

Re: VPS server settings - optimization for high speed

Posted: Tue Nov 16, 2021 3:00 am
by JNeuhoff
You should contact the Journal support, because you are using the Journal-framework, not the standard OpenCart framework.
Or use a proper standard-compliant web theme.

Re: VPS server settings - optimization for high speed

Posted: Tue Nov 16, 2021 5:05 pm
by ideep13
Nothing was really done on the theme., no coding nothing.. The host moved me from Tier 2 to Tier 1 VPS.

They have cheked into it and find out this:
Having checked the possible cause, we located:
[14-Nov-2021 11:05:29] WARNING: [pool djecje-kucice_com] server reached max_children setting (5), consider raising it
You can try increasing the max_children limit and tune the PHP-FPM performance as shown in the following guide https://support.cpanel.net/hc/en-us/art ... ing-Basics

Or switch the handler from PHP-FPM to lsapi. This handler does not require additional control of the PHP-FPM pool and takes fewer resources.
Here's a guide if you wish to switch it https://support.cpanel.net/hc/en-us/art ... PI-handler
Thank you for your cooperation.

Having checked the logs, we noticed:
[Mon Nov 15 07:24:33.103215 2021] [lsapi:error] [pid 2250:tid 47297042425600] [client 172.70.142.161:26140] [host djecje-kucice.com] Error receiving response header (lsphp is killed?): ReceiveResponseHeader: Wrong header number 122
[Mon Nov 15 07:24:52.217367 2021] [lsapi:error] [pid 2252:tid 47297140397824] [client 172.70.134.123:47322] [host djecje-kucice.com] Error receiving response header (lsphp is killed?): ReceiveResponseHeader: Wrong header number 399
[07:26] [server.xx.com ~] # date
Mon Nov 15 07:26:06 UTC 2021

Most likely it triggers during the upload of files to the site.
You can try fixing it by executing:
nano /usr/local/apache/conf/conf.d/lsapi.conf

then add: lsapi_backend_max_process_time 1800
and save the changes

after that - /etc/init.d/httpd restart

Let us know whether it works for you and if you still experience the 520 error message.
I think some bad PHP code is causing memory leak. Because I have zero knowledge about how to find what is causing this leak, I read some sites about this.. but I dont know if I can do this.

For the starters I thought I could just disable extensions one by one, but I can see all the extensions on modifications are disabled.

How can I find out what is causing this?

These are error logs

Re: VPS server settings - optimization for high speed

Posted: Thu Nov 18, 2021 4:11 pm
by ideep13
I contacted Journal support and this happened:

I have moved storage folder inside system folder under a random name for security reasons and after refreshing Opencart modifications your issue seems solved now. Most likely this was a problem related to Opencart Modifications System.
So if anyone will have similiar issue like I did.. now you know. Site now works, and he saved my business.

Re: VPS server settings - optimization for high speed

Posted: Thu Nov 18, 2021 5:37 pm
by ADD Creative
ideep13 wrote:
Thu Nov 18, 2021 4:11 pm
I contacted Journal support and this happened:

I have moved storage folder inside system folder under a random name for security reasons and after refreshing Opencart modifications your issue seems solved now. Most likely this was a problem related to Opencart Modifications System.
So if anyone will have similiar issue like I did.. now you know. Site now works, and he saved my business.
Are you using vQmod at all? It could of been this issue with vQmod. https://github.com/vqmod/vqmod/pull/152

Re: [SOLVED] VPS server settings - optimization for high speed

Posted: Thu Nov 18, 2021 5:48 pm
by ideep13
Yes I had the issue with this - see topic here: viewtopic.php?f=202&t=222464 I had to delete checked file every once in a while-. but than I removed QPhoria's VQmod and installed integrated one.

I can not remember if I done anything with storage folder.

I hope this is now fixed, site does work everyhere, which is a relief. I did switched to Isapi now from PHP-FPM while we tried to figure out the issue.. I hope that is ok too, or should I stayed on PHP-WHM?

Re: [SOLVED] VPS server settings - optimization for high speed

Posted: Thu Dec 02, 2021 4:10 pm
by ideep13
Here is the OCMOD log.

Re: [SOLVED] VPS server settings - optimization for high speed

Posted: Thu Dec 02, 2021 4:44 pm
by khnaz35
ideep13 wrote:
Thu Dec 02, 2021 4:10 pm
Here is the OCMOD log.
???

Re: [SOLVED] VPS server settings - optimization for high speed

Posted: Thu Dec 02, 2021 4:59 pm
by ideep13
I am posting differenet logs in case it will help to resolve the issue. I dont know what other to post?

Re: [SOLVED] VPS server settings - optimization for high speed

Posted: Thu Dec 02, 2021 6:21 pm
by ideep13
I am sorry but this should go to other topis.. I posted OCMOD file by mistake in this topic..