Search Postgresql Archives

Re: Postgres performance issue with High CPU usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just validate your environment once via the below states ... 

-top -p $(pgrep -d',' postgres)

-Review the PostgreSQL logs (typically located in /var/log/postgresql/ or /var/lib/pgsql/data/pg_log/)

-- check if any long running active query running via below query
SELECT pid, query, state, start_time, age(now(), start_time) AS duration
FROM pg_stat_activity
WHERE state = 'active'
ORDER BY duration DESC;

-- check if any locks persist via below query
SELECT pid, relation::regclass, mode, granted, query
FROM pg_locks l
JOIN pg_stat_activity a ON l.pid = a.pid
WHERE l.granted = 'f';

-- Analyze index if require via below qeury

EXPLAIN ANALYZE <your_query_here>;

--check if any autovacuum is in progress, that is also causes high CPU

SELECT * FROM pg_stat_autovacuum;

--Any background programs

SELECT * FROM pg_stat_bgwriter;

Thanks 
Rakesh 

On Tue, Feb 4, 2025 at 10:44 PM Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
On 2/4/25 09:11, KK CHN wrote:
> List,
>
> Could someone point out how can I trace what causes the edb-postgres 
> process with  %CPU usage reaching 73 to 80.1 percentage  in this box. 
>   What's wrong with the server VM..
What version of EDB database are you using?

If it is not their install of the community version available here:

https://www.postgresql.org/download/windows/

then this is probably a question for their tech support.

>
> The clients connecting the databases experience  slow responses ..
>
> The top out put of the DB server is  pasted below..
>
>
> Any hints  much appreciated to trouble shoot this unusual load on the
> server instance.
>
> Thank you,
> Krishane.
>
>
>
>
> I
>
> top - 22:34:13 up 61 days,  7:43,  3 users,  load average: 8.76, 9.92, 19.12
> Tasks: 697 total,   9 running, 687 sleeping,   1 stopped,   0 zombie
> %Cpu(s): 34.3 us, 18.7 sy,  0.0 ni, 46.2 id,  0.0 wa,  0.5 hi,  0.3 si,
>   0.0 st
> MiB Mem :  31837.6 total,   1296.9 free,  11447.0 used,  27969.1 buff/cache
> MiB Swap:   8060.0 total,   7400.0 free,    660.0 used.  20390.5 avail Mem
>
>      PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+
> COMMAND
> 4007576 enterpr+  20   0 8944520 951764 941212 R  80.1   2.9   0:57.24
> edb-postgres
> 4035945 enterpr+  20   0 8943056 472108 463068 R  79.7   1.4   0:11.48
> edb-postgres
> 4020721 enterpr+  20   0 8925752 702836 689644 S  73.1   2.2   0:27.99
> edb-postgres
> 4036409 enterpr+  20   0 8916540 368084 363772 S  43.5   1.1   0:01.31
> edb-postgres
> 4036410 enterpr+  20   0 8928512 481808 469852 S  32.2   1.5   0:03.52
> edb-postgres
>   442070 enterpr+  20   0 8908184 181248 180096 S  13.0   0.6   1391:16
> edb-postgres
> 4041239 enterpr+  20   0 8921696 995.0m 986.1m S   9.0   3.1   0:00.75
> edb-postgres
> 4041225 enterpr+  20   0 8921856

--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





--
Thanks & Regards
Rakesh Nashine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux