Jump to content

High cpu usage and faults out of nowhere


Recommended Posts

Posted (edited)

Hello, i'm looking for help in trying to fix my prestashop website.

A couple of days ago the website randomly started returning an error page saying 

Insufficient Storage

The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. There is insufficient free space left in your storage allocation.

Additionally, a 507 Insufficient Storage error was encountered while trying to use an ErrorDocument to handle the request.

Not every time, just a couple of times and then it went back to normal.

I have plenty of storage on my shared hosting so that is not the issue. A quick googling told me that it was caused by hitting cpu or db resource limits so i went to cpanel resource usage page and there was a spike in cpu usage, number of processes and faults (i'll attach some screenshots).
As you can see it's not high all the time, it stays high and occasionally fault for some hours, then goes down with no fault for some time and then back up. Could this be bots accessing the website?
Before this started, nothing was changed other than usual products uploading and modifications. No modules were installed or modified.
After it started i tried to "fix it" by updating to the latest non major version (from 1.7.8.5 to 1.7.8.11 i think), and update the theme. Did not help, not for long at least. I then tried to clean the db by deleting old abandoned carts and logs. Back office sped up but still did not help and i occasionally got the error page while visiting the website (either front or back office). I think that while i put the website into maintenance mode to do some work the usage dropped, so this might be a clue.
As you can see from the screenshots, on a normal day the usage is steady low, few processes running. When this issue started usage goes gradually up until it starts having like 20 processes, hitting limits and then faulting.
I could try to disable modules, but i would have to do it while out of maintenance and clients would load a broken page, so i'm hoping there is a better way that helps me understand what actually are those processes, what is spawning them and if they are caused by a fault module or something.
I have access to cpanel, db and ssh.

error 1.png

top -c.png

jul 1-9.png

jun 15.png

jul 7.png

Edited by TreRuote
forgot a couple of things (see edit history)
Link to comment
Share on other sites

It’s possible that your sudden high CPU usage is caused by what’s known as a “noisy neighbor” on shared hosting. This means another website on the same server could be overusing resources, causing performance issues for everyone else—including your PrestaShop shop.

If your hosting provider can’t find a clear cause within your own website, ask them directly:
“Is it possible that, because I’m on a shared plan, either my shop or another domain on the same server footprint is causing resource throttling?”

If they confirm this—or can’t provide a clear answer—the best solution is to upgrade to a VPS (Virtual Private Server) or a dedicated hosting plan. This will give you guaranteed resources, much better stability, and help avoid problems caused by other users’ activity.

  • Like 1
Link to comment
Share on other sites

Thank you for the suggestion, i will ask them about this specifically but from the messages we exchanged they did not mention this possibility. Also i don't see how this would cause a sudden increase in the number of processes running, from ~3 to ~20 (if anything, i am the noisy neighbor at this moment), maybe you are saying that each process will be throttled and so takes more time to complete and they accumulate? So my question here would be, what does a process like lsphp:...index.php do? or better, why are there more than one? does each one serve a bunch of visitors?

  • Like 1
Link to comment
Share on other sites

4 minutes ago, TreRuote said:

i am the noisy neighbor at this moment),

What are your hosting's specs? 

Shared servers have a lot of different set ups.  

Link to comment
Share on other sites

3 minutes ago, Nickz said:

What are your hosting's specs? 

Shared servers have a lot of different set ups.  

I don't know exactly, i would have to ask, but judging for the usage on a day without issues (like the screenshot of june 15th i attached, and it has been like that every day until the 4th of july) i'm not anywhere close to maxing them.

Link to comment
Share on other sites

Did you started something in your shop before you notice this activity in the background?
- product images refresh or delete redundant images (something with webp module), this can produce huge impact to recource of your shared host.
Check the size of your disk, if the size is increasing rapidly this is that.

Link to comment
Share on other sites

15 hours ago, TreRuote said:

Thank you for the suggestion, i will ask them about this specifically but from the messages we exchanged they did not mention this possibility. Also i don't see how this would cause a sudden increase in the number of processes running, from ~3 to ~20 (if anything, i am the noisy neighbor at this moment), maybe you are saying that each process will be throttled and so takes more time to complete and they accumulate? So my question here would be, what does a process like lsphp:...index.php do? or better, why are there more than one? does each one serve a bunch of visitors?

you can now feed hosting logs into AI which provides pretty good insigths, for example we can now upload a log, that they expect us to read line by line, and AI identfies general issue or what you ask to know....you can even upload your screen shots....

I have small blog mysql optimization

https://prestaheroes.com/blogs/mysql-optimization

when you say share, that generally means you do not have root access correct?

anyway, high end and lowly shared have same charateristic, non optimized mysql.cnf...

 

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

Thanks i'll look into this, i don't think i have root access but i will ask to change the db configuration as per your guides.
But my question still remains, it always worked fine, why would the un-optimized db suddenly give issues one random day, when the day before everything was well under the usage limits.
I don't think i can find a solution until i know the cause, you are suggesting to feed logs to AI but what kind of logs? is there a specific folder i should look for? or cpanel tool

Link to comment
Share on other sites

5 minutes ago, TreRuote said:

I don't think i can find a solution until i know the cause, you are suggesting to feed logs to AI but what kind of logs? is there a specific folder i should look for? or cpanel tool

Webserver log (Apache OR nginx) i.e. access log and error log. 

AI can give you insights if there any any bots OR ddos attack on the website. 

 

 

Link to comment
Share on other sites

36 minutes ago, TreRuote said:

Thanks i'll look into this, i don't think i have root access but i will ask to change the db configuration as per your guides.
But my question still remains, it always worked fine, why would the un-optimized db suddenly give issues one random day, when the day before everything was well under the usage limits.
I don't think i can find a solution until i know the cause, you are suggesting to feed logs to AI but what kind of logs? is there a specific folder i should look for? or cpanel tool

sitll reamains because it's a complex issue, a webmaster with hands on could figure it out, here we do 200 recommendations until one sticks.....you can waste a lot of  your  time trying to figure it for yourself, should you not be promoting your products and increasing sales? Just get better hosting...or get a wembaster access...I could have posted way more than noisy neighbor,  but I think you are right you are the nosiy neighbor loooool.

 

32 minutes ago, Knowband Plugins said:

Webserver log (Apache OR nginx) i.e. access log and error log. 

AI can give you insights if there any any bots OR ddos attack on the website. 

 

 

no kidding, plus for those running for example mod_security,  which proivdes zero alerts so you don't know who is getting blocked...its a christams miracle....at original poster, it even reads your screen shots, we don't looool

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...