Postgres using 100% of CPU

So I’m getting the exact same problem again, 2 years later :slight_smile:

It’s still getting stuck on the EnsureDbConsistency task, and spawning new ones until the server load is very high.

All of the connections are the same as before,

DELETE FROM user_actions USING user_actions ua2    
WHERE (user_actions.action_type = ua2.action_type AND
 user_actions.user_id = ua2.user_id AND user_actions.acting_user_id = ua2.acting_user_id AND 
 user_actions.target_post_id > 0 AND user_actions.id > ua2.id
 )

I’ve tried the previous solution, the vacuum command… except now it tells me this:

postgres=# VACUUM VERBOSE ANALYZE user_actions;
ERROR:  relation "user_actions" does not exist

Any help would be appreciated. Is there a command I can run on the Postgres command line that will clean up the whole database?

This keeps spawning new jobs but they never seem to finish.