public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rakesh Nashine <[email protected]>
To: Adrian Klaver <[email protected]>
Cc: KK CHN <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Postgres performance issue with High CPU usage
Date: Tue, 4 Feb 2025 23:05:29 +0530
Message-ID: <CAP_RtMQ-b10Da18Eh2EYFoxf2eWXhheBnV_LdvS7Xrv6+VHR6Q@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAKgGyB-P98RLmy5Zjs6CUziBQ+cqQSUmx1dJw=mMJwWT8gymJg@mail.gmail.com>
<[email protected]>
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 <[email protected]>
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
> [email protected]
>
>
>
>
--
Thanks & Regards
Rakesh Nashine
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Postgres performance issue with High CPU usage
In-Reply-To: <CAP_RtMQ-b10Da18Eh2EYFoxf2eWXhheBnV_LdvS7Xrv6+VHR6Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox