I recently set up NetData on our linode. I am not a sysadmin person but having a technical background, I can understand the basics but struggle with nitty gritty of it. I noticed something strange straight away that the CPU counter would spike to like 70 or even 80% randomly two or three times every minute https://pasteboard.co/H7iq8Ij.png
(those of you who haven't used Netdata, it's an awesome tool!) I was surprised that it was doing it when the website barely had any visitors less than 5. Although i looked a little bit into it but didn't have time to investigate further.
Then I did some load testing yesterday on our linode. A bit of background: I set up a 2G linode box using Runcloud although made some minor modifications to it later. I can tweak things here and there but don't have the expert knowledge to set everything up myself. It's a Nginx/Apache hybrid setup for max speed. On the box we run a Woocommerce (WP plugin) based e-commerce website with extensive caching and are also using Redis on the side. So basically most of the times pages are just served from the cache. The obvious exceptions when things are added to carts and checkouts or if they hit posts/pages that aren't already in cache. So back to load testing....50 VUs for 5 mins with extensive e-commerce related scenarios....and the CPU was up to 100% for almost all of those 5 minutes! The website became extremely slow because of that, it didn't crash gladly but the performance hit was huge.
Using netdata, i saw that it was the 'user' that was taking up cpu resources around 90%. Looking into what this user it was basically Runcloud and for that user, almost 94% of the resources was taken by PHP. Now I don't know how to dig further and what inside PHP was causing this but it's a real cause of concern for me since the website could easily be brought to its knees by barely 100 users then! I have been looking at various guides that go into settings like post_max_size and memory limits but they ALL appear to be within recommended ranges for our box....can anyone please give some pointers? Thank you!!