Skip to content

Postgres high CPU usage  #68

@Phu2

Description

@Phu2

From monit alert:

	Date:        Wed, 04 Dec 2024 12:27:58
...
	Description: cpu user usage of 97.7% matches resource limit [cpu user usage > 80.0%]

postgres processes on production server, sorted by CPU usage:

sudo ps --sort=-pcpu auxf | grep postgres
...
100070   1848558  0.0  0.1 191460 10232 ?        Ss   04:57   0:00  \_ postgres
100070   1902894 36.3  1.3 240872 105844 ?       Rs   12:23  19:29      \_ postgres: parallel worker for PID 2429   
100070   1903199 36.2  1.2 240876 102528 ?       Rs   12:25  18:38      \_ postgres: parallel worker for PID 2443   
100070   1902937 36.0  1.4 244784 114172 ?       Rs   12:23  19:14      \_ postgres: strapi strapi 192.168.192.3(56116) SELECT
100070   1902939 36.0  1.2 244744 104956 ?       Rs   12:23  19:12      \_ postgres: strapi strapi 192.168.192.3(33680) SELECT
100070   1902959 36.0  1.2 240868 99116 ?        Rs   12:23  19:11      \_ postgres: parallel worker for PID 2445   
100070   1903070 36.0  1.3 236568 110524 ?       Rs   12:24  18:56      \_ postgres: strapi strapi 192.168.192.3(34080) SELECT
100070   1903094 36.0  1.3 236600 113232 ?       Rs   12:24  18:49      \_ postgres: strapi strapi 192.168.192.3(43746) SELECT
100070   1902960 35.8  1.0 240648 81928 ?        Rs   12:23  19:04      \_ postgres: strapi strapi 192.168.192.3(33694) SELECT
100070   1902570 34.4  1.9 240812 161028 ?       Rs   12:20  19:27      \_ postgres: strapi strapi 192.168.192.3(56312) SELECT
100070   1902576 34.4  1.7 244672 140004 ?       Rs   12:20  19:29      \_ postgres: strapi strapi 192.168.192.3(56374) SELECT
100070   1902913 12.8  1.1 232680 94660 ?        Ss   12:23   6:52      \_ postgres: parallel worker for PID 2423   
100070   1902985  0.4  0.9 232672 74568 ?        Ss   12:23   0:13      \_ postgres: parallel worker for PID 2448   
100070   1848690  0.0  0.1 191516 14848 ?        Ss   04:57   0:00      \_ postgres: checkpointer   
100070   1848691  0.0  0.0 191472  7172 ?        Ss   04:57   0:00      \_ postgres: background writer   
100070   1848692  0.0  0.0 191460  4464 ?        Ss   04:57   0:00      \_ postgres: walwriter   
100070   1848693  0.0  0.0 191980  2768 ?        Ss   04:57   0:00      \_ postgres: autovacuum launcher   
100070   1848694  0.0  0.0  45964  1232 ?        Ss   04:57   0:00      \_ postgres: stats collector   
100070   1848695  0.0  0.0 191888  1432 ?        Ss   04:57   0:00      \_ postgres: logical replication launcher   

Docker Stats:

sudo docker stats
CONTAINER ID   NAME                                           CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
b78d7ff9c594   strapi-rpb                                     0.02%     126MiB / 7.763GiB     1.58%     72.3MB / 96.9MB   114MB / 13.9MB    22
7e280fa48953   strapi-rpbDB                                   422.24%   1.011GiB / 7.763GiB   13.03%    28.3MB / 56.2MB   17GB / 49.3GB     19
...

See also statistics in our internal vcenter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions