• Hi everyone, I know this topic has been around for quite a while but I haven’t been able to resolve my issue.

    I am building 4 websites with a light-weight theme and minimum plugins. WP-cron is disabled and it’s running manually once per hour. RAM limit is 1,5GB.

    Theme: GeneratePress (extremely light-weight)
    CDN: Optimole
    Cache: WP Fastest Cache
    Optimization: Autoptimize
    WordPress 5.7 on PHP 7.4

    Other plugins: Yoast, iThemes security, WP 2FA, WP Armour, Simple CSS, Shortcodes Ultimate, Popup anything on click, Contact Form 7, WP statistics

    I have tried disabling the hardest possible CPU usage culprits: iThemes and Statistics but the result was the same.

    Websites are very lightweight and with minimal coding – all 4 websites are scoring A on GTmetrix with 95+ on structure.

    Last time my websites crashed – there were around 30 people connected at the same time and “ps aux” gave out that one of the website’s index.php is using all the resources (around 20 processes opened). I know that everything goes over index.php etc.

    When my websites are idle – Memory usage is around 800mb of RAM which is waaay too much IMO. CPU is generally OK, but spikes A LOT even after 5 users are browsing through the website.

    I tried contacting my host and they said it has to be one of the plugins, but I have not found a solution yet.

    When websites are idle, there are around 25 “lsphp” processes constantly running in the background – using out these 800MB of RAM.

    Any thought, advice or suggestion would be really helpful.

    • This topic was modified 3 years, 8 months ago by dorianc.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @dorianc, this is a tough scenario to give specific and concrete advice on, as it relates to many plugins and specifics of your exact server configuration.

    One idea that came to mind though—have you experimented with other caching plugins? That might be a good place to start, as a cache plugin is likely the best way to limit php process execution and keep cpu usage down. WP Fastest Cache is usually an excellent choice though.

    An other suggestion would be to check the access logs for your site. Are there particular pages or endpoints being visited frequently that might use a lot of resources? Access logs could help provide that information.

    Dion

    (@diondesigns)

    First, GTMetrix scores have nothing to do with server issues. You could get a perfect 100 score yet have a server that crashes constantly due to excessive load.

    You should try deactivating all your plugins, not just the ones you think are the culprits. (For example, you didn’t deactivate WordPress SEO…and that’s the first one I would have suggested you deactivate.)

    If you still have issues after deactivating all your plugins, then talk to your host again. The lsphp process is something commonly seen in cPanel-based VPSes, and it’s possible/probable that Apache is not set up and configured correctly.

    Thread Starter dorianc

    (@dorianc)

    Thanks for the responses. I have tried other caching plugins – same result.
    I was just mentioning GTmetrix score to say there are no heavy scripts on the websites like sliders etc. – I know it does not have to do anything with the resources used on the server.

    I’ll try with full de-activation tomorrow morning. For now I disabled Yoast SEO, Statistics, WP Fastest cache & iThemes security. Still getting the same result.

    Thanks once more for taking time helping out!

    Thread Starter dorianc

    (@dorianc)

    I have disabled heartbeat – and RAM usage lowered to 500MB in idle state for 4 WordPress (still a bit too high IMO).

    Still getting a bunch of lsphp processes. I really think it’s my hosting fault and misconfiguration with lsphp Idle processes & concurrent available processes running. I was monitoring and some processes kept running for 20 minutes.

    As a temporary fix – I have created a cronjob that runs every 2 minutes “pkill -o lsphp” – which kills the oldest lsphp process on the list.

    I am not sure what consequences will that have on WP – but I killed all ‘lsphp’ processes multiple times when RAM was on 100% and did not notice anything weird.

    Hey,

    Any updates on your issue? I might have a similar problem.

    I upgraded our website from php 7.2 to 7.4 and It’s caused an drastic increase in CPU usage to the point our site is being limited.

    I have fixed every error/notice/bug on the site so thats not an issue for me.

    I realised not all PHP Extension are the same on my 7.4 as they were on 7.2 so by enabling those the CPU managed to calm down but is still pretty high at 20% (normally it runs around 5-10 for us)

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘100% CPU & process usage’ is closed to new replies.