Wordpress vs virtualmin / webmin

Hello, I have a server with Virtualmin/Webmin installed, where I host 2 websites (eidisis247.gr - eidisis24.gr). Lately, I noticed that even the simplest task (like publishing a single article) causes the CPU usage to spike to 300%-500%. I should mention here that the database for eidisis247.gr is around 9GB (1,120,000 articles). Has anyone encountered this? I have been trying to fix it for days without finding a solution. This happens (when the CPU goes over 100% and gets stuck there) on both websites, although the second one has a lighter load due to a smaller database.

SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.5
Virtualmin version Version 8.3.0 GPL, master administrator mode

Just looking at the site, images don’t seem to be optimized for web and you don’t seem to have done much work on optimizing the site at all.
Using a tool like https://pagespeed.web.dev will show you whats wrong.

How many revisions do you keep.
Check this may help reduce database size.

I found from static to dynamic or on-demand in the PHP-FPM setting help reduce cpu usage.

It’s irrelevant that you’re managing your WordPress with Virtualmin/Webmin. Virtualmin is not in the request path at all. It isn’t the web server (that’s Apache or nginx), the application server (that’s PHP-FPM), or the database (that’s Mariadb or MySQL, probably). You could even stop Webmin/Virtualmin completely and your pages would continue to be delivered as normal; Virtualmin is literally not involved (it renews your Let’s Encrypt certs, among other things, so you can’t leave it stopped forever, but if you want to prove to yourself that Virtualmin isn’t involved in your problem, you could do it temporarily).

You’re on a reasonably modern OS, so you have a reasonably modern Mariadb, so I wouldn’t expect any notable issues there.

I am inclined to blame one or more misbehaving WordPress plugins. You could enable slow query logging to see which specific queries are taking a long time. Slow Query Log Overview | Server | MariaDB Documentation

You can try disabling some plugins in WordPress (anything you don’t need to deliver the pages, stuff like analytics, etc.). This is probably where I would start, because it’s very easy to do and any problem in WordPress is almost always a misbehaving plugin. Prune down to just the absolute necessary plugins and see if that helps. If it does, you can re-enable them one at a time to narrow down the biggest culprit in your performance problem.

A 9GB database isn’t that big, but 1 million articles is pretty large for a WordPress site, but not unheard of. I don’t know what indexes WordPress sets up automatically, but you may need to add some.

Anyway, this is a WordPress performance and tuning question, rather than a Virtualmin question. We’re happy to help, I just want to make sure you’re looking in the right direction for solutions. If you’re trying to tune Virtualmin or Webmin, you’re wasting time that could be spent on identifying the actual problem.

I have tried everything… from PHP 8.4 down to 8.3, deactivating all plugins, changes in child themes, increasing memory limit… It’s dynamic, it’s just not logical for a single article insertion to max out the CPU. Is there someone I can give my logins to, take a look, find a solution, and tell me a quote on how much it would cost to get my server sorted out… unless WordPress itself is to blame

I wouldn’t recommend sharing your login credentials with anyone! You’ll need to troubleshoot this yourself. Try spinning up a new server and see if you can reproduce the issue there. I’d try Ubuntu 26.04, Debian 13, or Rocky 10. It’s a bit like using a cannon to shoot sparrows, but it’s probably the simplest way to rule out any issues specific to your current server’s configuration or environment.

  • are your servers getting scraped?
  • are you getting cache busted?
  • like Joe says, is it slow mysql command?
  • are you using innodb or myisam? Maybe this makes a difference.

You need to look at your logs :blush:

Be careful who you hand over credentials to. There are folks with a good reputation who do sysadmin work here in the forum.

But, anyone who looks into it is going to need to do the same kind of troubleshooting I’ve suggested, and can continue to suggest. There is no secret “go fast” button that will make all your problems go away.

You should look at your traffic patterns; are you suddenly serving a lot more requests? If so, you might find using a caching plugin that serves static pages would help

Or putting a caching CDN in front may help, if you’re not already using one. In normal circumstances, something like Cloudflare adds a hop and makes dynamic pages slower, but in the case where your server is overwhelmed, having it serve everything that’s cachable from their servers and drastically reduce

But, you need to look at logs. Error log, access log. Figure out what’s actually happening.

Ilia, it is crazy to suggest trying three random operating systems when we don’t even know what the problem is. It may be that a newer Mariadb version will be more efficient for some workloads, but I wouldn’t bet on it; they’re already on a pretty new OS and version.

I would recommend OP figure out what problem they’re trying to solve before they start trying to solve it.

Continuing the discussion from Wordpress vs virtualmin / webmin:

Example… I started a process from WPMatico to pull 10 articles… From that moment on, for 40 minutes the CPU was at 650%…
In the past, this used to take 15 seconds and the CPU… was idling…

To be able to calm it down, I ran the following…

Even when I did a kill and when I did a restart… immediately the CPU went back to the red zone…

I did kill and restart many times through Webmin as well…
And I notice, perhaps the company’s tech team should look into this, that after every PHP upgrade on the server (Virtualmin) I have issues like this…

Which log files do you want me to send you?..

admin@eidisis247gr:~$ sudo pkill -u eidisis247 -9
[sudo] password for admin:
admin@eidisis247gr:~$ sudo systemctl restart php8.3-fpm
admin@eidisis247gr:~$ sudo systemctl restart php8.4-fpm
admin@eidisis247gr:~$ sudo systemctl restart mariadb php8.4-fpm
admin@eidisis247gr:~$ ^C
admin@eidisis247gr:~$ sudo pkill -9 -f php
sudo pkill -9 -f mariadbd
sudo pkill -9 -f mysqld
sudo systemctl restart mariadb php8.4-fpm
Killed
Killed
Killed
admin@eidisis247gr:~$ sudo pkill -u eidisis247 -9
admin@eidisis247gr:~$ sudo systemctl restart mariadb php8.4-fpm
admin@eidisis247gr:~$

I don’t want you to send me logs, I want you to look at them. The access log and the error log for the domain in question. If you don’t know what you’re looking at, you can post a few entries here, hopefully there will be some clues there.

Restarting and killing services isn’t expected to solve any problems.

You need to figure out what’s causing a dramatic increase in usage, so you need to look at logs. Maybe it’s a bunch of AI bots crawling your million pages, in which case, you have options (some of which I’ve already mentioned).

Also, I don’t see any indication you’ve figured out which process is causing all the usage. You should watch top while CPU is spiking.

Do you run wordfence(or similar software)? It will do a scan everyday and I noticed it will use alot of CPU when the scan happens.

ALL THIS FOR ONE POST…???

MariaDB [eidisis247_gr]> SHOW FULL PROCESSLIST;
ERROR 2006 (HY000): Server has gone away
No connection. Trying to reconnect...
Connection id:    15384
Current database: eidisis247_gr

+-------+------------+-----------+---------------+---------+------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| Id    | User       | Host      | db            | Command | Time | State               | Info                                                                                                                                                                                                                                                                                                                                                                                                                      | Progress |
+-------+------------+-----------+---------------+---------+------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| 15128 | eidisis247 | localhost | eidisis247_gr | Query   |    4 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15137 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15138 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15139 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15157 | eidisis247 | localhost | eidisis247_gr | Query   |    4 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15182 | eidisis247 | localhost | eidisis247_gr | Query   |    1 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15193 | eidisis247 | localhost | eidisis247_gr | Query   |    2 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15194 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15197 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15203 | eidisis247 | localhost | eidisis247_gr | Query   |    4 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15213 | eidisis247 | localhost | eidisis247_gr | Query   |   19 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15225 | eidisis247 | localhost | eidisis247_gr | Query   |    2 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15247 | eidisis247 | localhost | eidisis247_gr | Query   |   15 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15248 | eidisis247 | localhost | eidisis247_gr | Query   |   14 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15254 | eidisis247 | localhost | eidisis247_gr | Query   |    4 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15259 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15281 | eidisis247 | localhost | eidisis247_gr | Query   |    2 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15286 | eidisis247 | localhost | eidisis247_gr | Query   |    0 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46,106)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 3, 3                            |    0.000 |
| 15288 | eidisis247 | localhost | eidisis247_gr | Query   |   18 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15315 | eidisis247 | localhost | eidisis247_gr | Query   |    5 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15322 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15324 | eidisis247 | localhost | eidisis247_gr | Query   |    2 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1, 2                                   |    0.000 |
| 15330 | eidisis247 | localhost | eidisis247_gr | Query   |   18 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND wpnl_posts.ID NOT IN (1046987) AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (47)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date ASC
                                         LIMIT 0, 2 |    0.000 |
| 15334 | eidisis247 | localhost | eidisis247_gr | Query   |   14 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 0, 13                               |    0.000 |
| 15352 | eidisis247 | localhost | eidisis247_gr | Query   |    9 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 0, 13                               |    0.000 |
| 15361 | eidisis247 | localhost | eidisis247_gr | Query   |    6 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (29,46)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 0, 13                               |    0.000 |
| 15367 | eidisis247 | localhost | eidisis247_gr | Query   |    3 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND wpnl_posts.ID NOT IN (1376827) AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (28)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date ASC
                                         LIMIT 0, 2 |    0.000 |
| 15373 | eidisis247 | localhost | eidisis247_gr | Query   |    1 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND wpnl_posts.ID NOT IN (549670) AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (37)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date ASC
                                         LIMIT 0, 2  |    0.000 |
| 15377 | eidisis247 | localhost | eidisis247_gr | Query   |    1 | Sending data        | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts  LEFT JOIN wpnl_term_relationships ON (wpnl_posts.ID = wpnl_term_relationships.object_id)
                                         WHERE 1=1  AND wpnl_posts.ID NOT IN (626888) AND ( 
  wpnl_term_relationships.term_taxonomy_id IN (24)
) AND wpnl_posts.post_type = 'post' AND ((wpnl_posts.post_status = 'publish'))
                                         GROUP BY wpnl_posts.ID
                                         ORDER BY wpnl_posts.post_date ASC
                                         LIMIT 0, 2  |    0.000 |
| 15378 | eidisis247 | localhost | eidisis247_gr | Query   |    1 | Creating sort index | SELECT   wpnl_posts.ID
                                         FROM wpnl_posts 
                                         WHERE 1=1  AND (wpnl_posts.post_author = 3) AND ((wpnl_posts.post_type = 'post' AND (wpnl_posts.post_status = 'publish')))
                                         
                                         ORDER BY wpnl_posts.post_date DESC
                                         LIMIT 1101420, 10                                                                                                                                                                    |    0.000 |
| 15380 | eidisis247 | localhost | eidisis247_gr | Sleep   |    0 |                     | NULL                                                                                                                                                                                                                                                                                                                                                                                                                      |    0.000 |
| 15382 | eidisis247 | localhost | eidisis247_gr | Sleep   |    0 |                     | NULL                                                                                                                                                                                                                                                                                                                                                                                                                      |    0.000 |
| 15383 | eidisis247 | localhost | eidisis247_gr | Sleep   |    0 |                     | NULL                                                                                                                                                                                                                                                                                                                                                                                                                      |    0.000 |
| 15384 | root       | localhost | eidisis247_gr | Query   |    0 | starting            | SHOW FULL PROCESSLIST                                                                                                                                                                                                                                                                                                                                                                                                     |    0.000 |
| 15385 | eidisis247 | localhost | eidisis247_gr | Sleep   |    0 |                     | NULL                                                                                                                                                                                                                                                                                                                                                                                                                      |    0.000 |
+-------+------------+-----------+---------------+---------+------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
35 rows in set (0.704 sec)

top - 10:27:42 up 7 days, 16:39, 0 user, load average: 35.29, 22.44, 11.47
Tasks: 317 total, 5 running, 310 sleeping, 2 stopped, 0 zombie
%Cpu(s): 97.3 us, 2.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.2 si, 0.1 st
MiB Mem : 14792.8 total, 2773.8 free, 9908.9 used, 2591.5 buff/cache
MiB Swap: 4096.0 total, 3748.6 free, 347.4 used. 4883.9 avail Mem

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                                                                  

857084 mysql 20 0 15.0g 5.9g 28160 S 832.2 41.1 201:42.75 mariadbd
898661 eidisis+ 20 0 335388 138020 100120 S 21.7 0.9 0:05.92 php-fpm8.3
897314 eidisis+ 20 0 409532 142720 105752 R 16.4 0.9 0:04.93 php-fpm8.3
897725 eidisis+ 20 0 333328 149212 113432 S 12.5 1.0 0:04.69 php-fpm8.3
897801 eidisis+ 20 0 332368 146000 112792 S 12.2 1.0 0:05.22 php-fpm8.3
897757 eidisis+ 20 0 332448 146464 111384 S 9.2 1.0 0:03.76 php-fpm8.3
872946 eidisis+ 20 0 414144 189320 147352 S 8.9 1.2 2:58.52 php-fpm8.3
898214 eidisis+ 20 0 332936 147560 113048 S 8.9 1.0 0:03.50 php-fpm8.3
898140 eidisis+ 20 0 331280 145848 112128 R 8.2 1.0 0:04.55 php-fpm8.3
898622 eidisis+ 20 0 333888 146900 110232 S 5.9 1.0 0:02.28 php-fpm8.3
326315 redis 20 0 3099464 435852 9344 S 5.3 2.9 106:28.03 redis-server
898119 eidisis+ 20 0 329284 143252 112536 S 4.9 0.9 0:04.58 php-fpm8.3
899261 root 20 0 23920 16768 7808 R 4.9 0.1 0:00.15 fail2ban-client
804007 netdata 20 0 1157296 172620 33832 S 4.6 1.1 12:28.78 netdata
804579 netdata 20 0 185180 12032 5248 S 3.3 0.1 7:01.88 apps.plugin
352199 root 20 0 120608 92700 7040 S 2.6 0.6 29:38.01 stats.pl
1563 root 20 0 4774076 53924 34232 S 0.7 0.4 108:31.23 fail2ban-server
898555 www-data 20 0 3794908 24488 9216 S 0.7 0.2 0:00.55 apache2
17 root 20 0 0 0 0 I 0.3 0.0 52:36.86 rcu_preempt
1233 root 20 0 5476580 13840 6272 S 0.3 0.1 29:18.35 incus-agent
1459 root 20 0 19048 7380 6528 S 0.3 0.0 13:37.45 systemd-logind
804619 netdata 20 0 1518448 125440 85632 S 0.3 0.8 1:48.29 go.d.plugin
898229 eidisis+ 20 0 337168 151536 112664 S 0.3 1.0 0:04.23 php-fpm8.3
898236 www-data 20 0 4241848 30132 9216 S 0.3 0.2 0:01.22 apache2
898721 admin 20 0 9044 5504 3328 R 0.3 0.0 0:00.37 top
1 root 20 0 23336 11784 7808 S 0.0 0.1 6,46 systemd
2 root 20 0 0 0 0 S 0.0 0.0 1:36.87 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pool_workqueue_release
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-rcu_g
5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-rcu_p
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-slub_
7 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-netns
9 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-events_highpri
12 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-mm_pe
13 root 20 0 0 0 0 I 0.0 0.0 0:00.01 rcu_tasks_kthread
14 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_tasks_rude_kthread
15 root 20 0 0 0 0 I 0.0 0.0 0:00.01 rcu_tasks_trace_kthread
16 root 20 0 0 0 0 S 0.0 0.0 0:45.81 ksoftirqd/0
18 root rt 0 0 0 0 S 0.0 0.0 0:04.74 migration/0
19 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/0
20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
21 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
22 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/1
23 root rt 0 0 0 0 S 0.0 0.0 0:05.48 migration/1
24 root 20 0 0 0 0 S 0.0 0.0 0:35.11 ksoftirqd/1
26 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0H-events_highpri
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/2
28 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/2
29 root rt 0 0 0 0 S 0.0 0.0 0:05.30 migration/2
30 root 20 0 0 0 0 S 0.0 0.0 0:29.75 ksoftirqd/2
32 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/2:0H-events_highpri
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/3
34 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/3
35 root rt 0 0 0 0 S 0.0 0.0 0:05.27 migration/3
36 root 20 0 0 0 0 S 0.0 0.0 0:27.85 ksoftirqd/3
38 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/3:0H-events_highpri
39 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/4
40 root -51 0 0 0 0 S 0.0 0.0 0:00.00 idle_inject/4

So, the big CPU user is definitely the database, which is expected, it usually is in a WordPress site.

Given that, if I were in your shoes, the first thing I’d probably do is, one way or another, get static pages for non-logged in users into a cached form, so they don’t have to hit the database. If it’s crawlers that are slamming your server, they won’t be logged in, most likely, and if you can serve them without hitting the db, you’ll probably be able to weather the onslaught.

You could also figure out who the biggest offenders are and block them in robots.txt or at the firewall.

You could also setup Cloudflare, though you have to make sure those pages are cachable by Cloudflare, at least when the requesting client isn’t logged in. Cloudflare only caches what it is told to cache via cache-control headers; there are many ways to accidentally bust any cache you don’t directly control.

I have blocked all attacks through Cloudflare… the server only spikes when a new article is being inserted…"

With these settings, it stopped crashing and freezing the CPU… but it still maxes out during article insertion.

SET GLOBAL max_statement_time = 0;
SET SESSION max_statement_time = 0;
SET SESSION net_read_timeout = 3600;
SET SESSION net_write_timeout = 3600;
SET SESSION wait_timeout = 3600;

ALTER TABLE wpnl_postmeta
ADD INDEX idx_meta_key_val (meta_key(191), meta_value(191)),
ALGORITHM=INPLACE, LOCK=SHARED;

Let me say something.. personally I am clueless about SSH, servers, etc.. I set it up with the help of AI, Gemini… it was working fine, I had no issues… this suddenly happened after an update performed by Virtualmin/Webmin.

an update to what exactly ? This may help others to understand what’s going on. I don’t use wordpress so I am not able to offer any assistance with wordpress issues

The Virtualmin / Webmin panel regularly suggests server updates, new PHP versions, etc… Since it recommends them to me, I apply them."

So in other words You don’t have a clue on what update webmin applied that caused the problem. This ‘virtualmin update’’ could be unrelated as you may have wordpress auto updates (have a look at this) switched on and the error may have occurred at a similar time to the system updates that webmin applied and your thinking the problem lies with a system update when in fact it maybe a wordpress update. Someone who knows about wordpress maybe able to tell you if there is a log in wordpress that shows what core code/plugins have been updated and when, which in turn may show it’s a wordpress update that has caused your issue. I think it’s been said before by @joe disable all plugins and see if your resources return to normal, if it does enable each plugin individually and check your system resources before enabling the next plugin.
I write plugins for a forum software and have been caught out in the past by a core code change, which has made my plugin code go rouge

know WordPress, I’ve been setting up sites since its very first release… I have built sites for many clients, but using Plesk, etc.. this is the first time I set up a Virtualmin server for myself… Thanks anyway, I will look into it.. or if I find a technician who understands these things, I’ll see.