pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedidle transactions vs memory
7+ messages / 5 participants
[nested] [flat]
* idle transactions vs memory
@ 2020-12-07 02:29 Atul Kumar <akumar14871@gmail.com>
0 siblings, 3 replies; 7+ messages in thread
From: Atul Kumar @ 2020-12-07 02:29 UTC (permalink / raw)
To: pgsql-admin
Hi,
I have a basic query that do idle transactions (idle more than 5
minutes) occupy system memory (RAM) or CPU usage ?
Please help me.
Regards,
Atul
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 02:49 David G. Johnston <david.g.johnston@gmail.com>
parent: Atul Kumar <akumar14871@gmail.com>
2 siblings, 0 replies; 7+ messages in thread
From: David G. Johnston @ 2020-12-07 02:49 UTC (permalink / raw)
To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-admin
On Sunday, December 6, 2020, Atul Kumar <akumar14871@gmail.com> wrote:
> Hi,
>
> I have a basic query that do idle transactions (idle more than 5
> minutes) occupy system memory (RAM) or CPU usage ?
>
>
> Please help me.
>
>
Help you what? Queries don’t idle so I don’t even know what you are
looking at. But, generally, long-lived idle in transaction session are bad
for many reasons and you should fix your application code to avoid them.
David J.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 02:51 Ron <ronljohnsonjr@gmail.com>
parent: Atul Kumar <akumar14871@gmail.com>
2 siblings, 0 replies; 7+ messages in thread
From: Ron @ 2020-12-07 02:51 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
On 12/6/20 8:29 PM, Atul Kumar wrote:
> Hi,
>
> I have a basic query that do idle transactions (idle more than 5
> minutes) occupy system memory (RAM) or CPU usage ?
>
>
> Please help me.
Whether or not they occupy RAM or use CPU, idle transactions violate one of
the fundamental rules of database programming: keep transactions short!
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 02:58 Scott Ribe <scott_ribe@elevated-dev.com>
parent: Atul Kumar <akumar14871@gmail.com>
2 siblings, 1 reply; 7+ messages in thread
From: Scott Ribe @ 2020-12-07 02:58 UTC (permalink / raw)
To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-admin
> On Dec 6, 2020, at 7:29 PM, Atul Kumar <akumar14871@gmail.com> wrote:
>
> I have a basic query that do idle transactions (idle more than 5
> minutes) occupy system memory (RAM) or CPU usage ?
Actual idle transaction? Or just idle connections not currently in transactions?
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 05:34 Atul Kumar <akumar14871@gmail.com>
parent: Scott Ribe <scott_ribe@elevated-dev.com>
0 siblings, 2 replies; 7+ messages in thread
From: Atul Kumar @ 2020-12-07 05:34 UTC (permalink / raw)
To: pgsql-admin
Hi,
The transactions state is 'idle' from more than 15 minutes, so my
question is that are they occupying any amount of RAM?
are these 'idle' transactions are using CPU ?
Please help me.
Regards,
Atul
On 12/7/20, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
>> On Dec 6, 2020, at 7:29 PM, Atul Kumar <akumar14871@gmail.com> wrote:
>>
>> I have a basic query that do idle transactions (idle more than 5
>> minutes) occupy system memory (RAM) or CPU usage ?
>
> Actual idle transaction? Or just idle connections not currently in
> transactions?
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 05:41 David G. Johnston <david.g.johnston@gmail.com>
parent: Atul Kumar <akumar14871@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: David G. Johnston @ 2020-12-07 05:41 UTC (permalink / raw)
To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-admin
On Sunday, December 6, 2020, Atul Kumar <akumar14871@gmail.com> wrote:
> Hi,
>
> The transactions state is 'idle' from more than 15 minutes, so my
> question is that are they occupying any amount of RAM?
>
> are these 'idle' transactions are using CPU ?
>
>
Sessions and transactions are two different things.
Yes, idle sessions consume a non-zero amount of resources.
David J.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: idle transactions vs memory
@ 2020-12-07 08:47 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Atul Kumar <akumar14871@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Laurenz Albe @ 2020-12-07 08:47 UTC (permalink / raw)
To: Atul Kumar <akumar14871@gmail.com>; pgsql-admin
On Mon, 2020-12-07 at 11:04 +0530, Atul Kumar wrote:
> The transactions state is 'idle' from more than 15 minutes, so my
> question is that are they occupying any amount of RAM?
>
> are these 'idle' transactions are using CPU ?
They are not using any CPU, and they are using very little RAM.
They make starting a query (taking a snapshot) a little slower,
but you probably won't notice that.
Their biggest danger is that there is no guarantee that they
remain idle, and if you have too many active sessions, your database
might have more work than it can handle.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-12-07 08:47 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 02:29 idle transactions vs memory Atul Kumar <akumar14871@gmail.com>
2020-12-07 02:49 ` David G. Johnston <david.g.johnston@gmail.com>
2020-12-07 02:51 ` Ron <ronljohnsonjr@gmail.com>
2020-12-07 02:58 ` Scott Ribe <scott_ribe@elevated-dev.com>
2020-12-07 05:34 ` Atul Kumar <akumar14871@gmail.com>
2020-12-07 05:41 ` David G. Johnston <david.g.johnston@gmail.com>
2020-12-07 08:47 ` Laurenz Albe <laurenz.albe@cybertec.at>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox