# Postgres using 100% of CPU

**URL:** <https://meta.discourse.org/t/postgres-using-100-of-cpu/45261>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [5 juni 2016 om 00:19 UTC](https://meta.discourse.org/t/postgres-using-100-of-cpu/45261 "2016-06-05T00:19:26Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![MiG](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mig/32/119486_2.png) [@MiG](https://meta.discourse.org/u/MiG)\
**Post date:** [25 augustus 2018 om 02:11 UTC](https://meta.discourse.org/t/postgres-using-100-of-cpu/45261/16 "2018-08-25T02:11:07Z")

</div>

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

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.

---

_[View the full topic](https://meta.discourse.org/t/postgres-using-100-of-cpu/45261)._
