100% CPU usage in Linux server and Postgres database
Olivia Zamora
I'm using a Linux server (Ubunto 18.04) that hosts the Postgres database. PostgreSQL makes CPU Usage up-to 100% and sometimes the related web site is down and after server restarting the site turns to work fine.
Running the query:
SELECT
(now() - pg_stat_activity.query_start) as interval, state
FROM pg_stat_activityResults more than complex queries running at the same time responding to site navigation requests and depending on the number of connected users.
The problem is of the number of connected users increases the site is blocked and after restarting the database server it turns to work fine.
Could you please tell me how to solve this problem?
The server RAM is more than 23GB.
11 Answer
I believe you have to increase the connection pool as well as shared memory. This link should get you in the right place.
In retrospect though, what are the users all doing to cause these lockups?
2