cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

SOLVED
Highlighted

Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Hi Everyone,

 

Quick question to the community. I am currently running a magento 2.3.4 CE instance with 2vCPU and 4 GB ram for development purposes. Whenever I disable any cache option, Eg. Configuration, Page Cache,etc. Apache Services on my instance will consume 100 % of my CPU Utttilisation, and causes my Magento admin console to be in a freeze state and unresponsive. I was wondering if there is any workaround for this, as this is still a development server and disabling the cache would help expedite this process.

 

Any help on this is much appreciated. Thanks in advance all ! 

 

Regards,

Wen Jun.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Please follow the Magento recommendations and don't disable all caches during development as there is no need.

 

Instead only disable Page and Block caches leaving everything else cached.

 

https://devdocs.magento.com/guides/v2.3/performance-best-practices/development-environment.html

--
Problem solved? Click Accept as Solution!

View solution in original post

10 REPLIES 10
Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

You may want to consider either adding more CPU or switch to LiteSpeed Enterprise Web Server which is a drop in replacement for Apache but performs way better while being also more efficient so it uses much less CPU and RAM. 

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Hi JLHC, 

 

Thanks for the tips, will give both workaround a try and see the results. Much appreciated on your response for this. My thought previously on Server spec wise, was that if i comply to the system requirements suggested by Magento dev team, I could run this smoothly. Non the less I am open to any suggestions on this Smiley Happy

 

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

 

Regards,

Wen Jun.

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

As far as I understand the system requirements page did not list any recommendations for the number of CPUs. 

 

Here's a link where it details more about the CPU:-

https://devdocs.magento.com/guides/v2.3/performance-best-practices/hardware.html

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Does any specific reason to disabled cache? if you are on the development and doing kind of testing, then i would suggest to use developer mode which do render page without cache. 

 

I do suggest to make 4 Core CPU with 8 GB ram which do works

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Hi James Lee, 

 

I am trying out open lite speed web server instead of Apache right now, as per your recommendation. By any chance would you have a sample virtual host configuration I could try to configure with ?

 

I am having difficulty accessing the installation scripts for Magento2, running the "index.php" script under the /html folder, and to no prevail i have been getting the error 404 when i try accessing the installation scripts from my web browser.

 

The guide on Open Lite Speed website has pretty limited information on this, and there is near to zero guides pertaining this configuration online 😅. 

 

I am using the following guide : 

https://openlitespeed.org/kb/magento2/

 

Capture01.PNG

Regards,

Wen Jun.

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Hi Bhavesh Surani, 

 

I am disabling cache so that i do not have to keep flushing the cache everytime i make minor changes to my environment/website. It can be quite tedious assuming i am making 50 - 100+ over changes in the course of the development in a day. Most of the guides i see online also advise disabling the cache to expedite the development process.

 

Also I am already running in development mode as we speak. Is it a usual behavior for apache services to spike in CPU Usage when cache is disabled ?

 

Regards,

Wen Jun.

 

 

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Hi James Lee, 

 

Managed to solve the following problem regarding the Virtual Host matter. Mistook the $SERVER_ROOT parameter as the actual "/" root of my server and also, where in fact its under the /usr/local/lwsw/ , also modified permissions to allow execution to take place under the directories. All good now.

 

Regards,

Wen Jun.

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Sounds good. I do suggest taking a look at LiteSpeed Enterprise if you can as it is a drop-in replacement for Apache unlike OpenLiteSpeed. 

Highlighted

Re: Magento 2.3.4 CE - Disabling Cache causes 100% CPU Utillisation on Apache Services

Please follow the Magento recommendations and don't disable all caches during development as there is no need.

 

Instead only disable Page and Block caches leaving everything else cached.

 

https://devdocs.magento.com/guides/v2.3/performance-best-practices/development-environment.html

--
Problem solved? Click Accept as Solution!

View solution in original post