pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedBG writer question?
2+ messages / 2 participants
[nested] [flat]
* BG writer question?
@ 2005-08-11 15:25 Alan Stange <stange@rentec.com>
2005-08-11 16:43 ` Re: BG writer question? Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 2+ messages in thread
From: Alan Stange @ 2005-08-11 15:25 UTC (permalink / raw)
To: pgsql-performance
Hello all,
I just was running strace in the writer process and I noticed this pattern:
select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout)
getppid() = 4240
time(NULL) = 1123773324
mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0x81000) = 0x69ea3000
semop(1409034, 0xffffc0bc, 1) = 0
<...seeks and writes...>
munmap(0x69ea3000, 528384) = 0
select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout)
getppid() = 4240
time(NULL) = 1123773324
mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0x81000) = 0x69ea3000
semop(1605648, 0xffffc0bc, 1) = 0
<...seeks and writes...>
munmap(0x69ea3000, 528384) = 0
select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout)
why mmap and munmap each time? mmap and munmap are fairly expensive
operations (on some systems), especially on multi cpu machines. munmap
in particular generally needs to issue cross calls to the other cpus to
ensure any page mappings are invalidated.
Just curious.
Thanks!
-- Alan
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BG writer question?
2005-08-11 15:25 BG writer question? Alan Stange <stange@rentec.com>
@ 2005-08-11 16:43 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2005-08-11 16:43 UTC (permalink / raw)
To: Alan Stange <stange@rentec.com>; +Cc: pgsql-performance
On Thu, Aug 11, 2005 at 11:25:27AM -0400, Alan Stange wrote:
> why mmap and munmap each time? mmap and munmap are fairly expensive
> operations (on some systems), especially on multi cpu machines. munmap
> in particular generally needs to issue cross calls to the other cpus to
> ensure any page mappings are invalidated.
There are no mmap/munmap calls in our code. The problematic code is
probably somewhere in the libc. Maybe it'd be useful to figure out
where it's called and why, with an eye on working around that.
--
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"I love the Postgres community. It's all about doing things _properly_. :-)"
(David Garamond)
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-08-11 16:43 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11 15:25 BG writer question? Alan Stange <stange@rentec.com>
2005-08-11 16:43 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
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