@martin
I got this from siteground:
The errors were showing because there was excessive resource usage by your server by the MySQL service. This is why the server was not able to serve the requests for your websites and returning 500 errors.
The reason for the high usage by the MySQL was a large number of MySQL queries demanding a lot of resource. The reason they demand such resource is the size of your database thegre_mgm2 and the table wp_usermeta in particular. This table is 717MB and has nearly 1 million table rows. When a MySQL query is made, the server needs to crawl through all these rows and this exhausts it's resources.
Here are some of the slowest queries:
SELECT *, ug.name AS groupname, ug.color AS color FROM `wp_users` u INNER JOIN `wp_wpforo_profiles` p ON p.`userid` = u.`ID` LEFT JOIN `wp_wpforo_usergroups` ug ON ug.`groupid` = p.`groupid` WHERE p.`status` IN('active') AND (p.`groupid` IN(1, 2, 3, 4, 5) OR CONCAT(',', p.`secondary_groups`, ',') REGEXP ',(1|2|3|4|5),' ) ORDER BY posts DESC LIMIT 28455,15;
-------------------------------------------------------------------------------------------------------------------
Date: 2021-08-13 10:28:45 Query_time: 1708.013872 Rows_examined: 213252: Rows_sent 4 Lock_time: 0.000361 Query_chars: 361
SELECT *, ug.name AS groupname, ug.color AS color FROM `wp_users` u INNER JOIN `wp_wpforo_profiles` p ON p.`userid` = u.`ID` LEFT JOIN `wp_wpforo_usergroups` ug ON ug.`groupid` = p.`groupid` WHERE p.`status` IN('active') AND (p.`groupid` IN(1, 2, 3, 4, 5) OR CONCAT(',', p.`secondary_groups`, ',') REGEXP ',(1|2|3|4|5),' ) ORDER BY posts DESC LIMIT 50505,15;
-------------------------------------------------------------------------------------------------------------------
Date: 2021-08-13 10:27:45 Query_time: 1677.807039 Rows_examined: 216131: Rows_sent 3 Lock_time: 0.000247 Query_chars: 361
SELECT *, ug.name AS groupname, ug.color AS color FROM `wp_users` u INNER JOIN `wp_wpforo_profiles` p ON p.`userid` = u.`ID` LEFT JOIN `wp_wpforo_usergroups` ug ON ug.`groupid` = p.`groupid` WHERE p.`status` IN('active') AND (p.`groupid` IN(1, 2, 3, 4, 5) OR CONCAT(',', p.`secondary_groups`, ',') REGEXP ',(1|2|3|4|5),' ) ORDER BY posts DESC LIMIT 53385,15;
The database and these queries need to be optimize in order to guarantee the smooth server performance. In case you are not able to optimize these yourself please consult with a third party developer. We would not be able to perform optimization on your behalf because we specialize in finding and resolving hosting related problems. That said debugging third-party applications and/or developing code is not part of the standard hosting support we offer.
If you do not have a trusted developer, you can visit the Partner Perks section of your User Area where we have listed companies that offer WordPress development services and work on projects of any size. We partner with them because of the high-quality of the services they offer. You can review and take advantage of any partners’ special offers available for SiteGround clients on the Partner Perks page in the User Area.
Best Regards,
Anton Panov
Technical Support Team