Problems with modx & mysql

I’m getting issues with MySQL that are killing and restarting a bunch of services because something keeps eating up all my memory and then letting it go. I have no idea how to diagnose this let alone fix it.

When this occurs, my MySQL processes show this description:

167 | DB User | localhost | DB Name | Command: Query | Time: 5 | State: statistics | Info: SELECT, modResource.pagetitle, modResource.uri, modResource.parent, | Progess: 0.000

I’ve been getting notifications every hour or so for the last week. The hosting service doesn’t know what to do either. Has anyone ever seen this or have any ideas?

Also, may be unrelated but i’m not sure, I keep getting kicked out of MODX every so often during this.

Thank you for any input.

For when someone who knows more than me comes along it would probably be a good idea to list your MODX version, MySQL version, PHP version, database type and table type (ie: InnoDB or MyISAM).

It looks as if the query is getting stuck in the ‘Statistics’ state. You might want to check and then repair the tables if necessary. I read that this can happen if you have a lot of tables joined. Is this a standard install, or do you have additional tables? (Back up your tables before doing anything).

MODX v2.8.1
MySQL v10.2.35-MariaDB
PHP v7.3.23

Mostly a standard install, but there are some custom tables from MIGX and another app.

Is caching enabled/disabled?

I’m not sure, how do I tell?

I’ve also gotten this message a bunch in the last few days in my MODX error log:
(FATAL) The requested resource has no valid content type specified.

But it doesn’t say anything about what or where the problem is.

You could check the columns “contentType” (respectively “content_type”) of the database table “modx_site_content” for missing/wrong values or run this SQL command:

SELECT * FROM `modx_site_content` content WHERE NOT EXISTS (SELECT * FROM `modx_content_type` WHERE id = content.content_type)

I checked that and it returned zero results

You can see the various caching options in System Settings --> Filter by area --> Caching.