Thomas Munro
2018-07-02 12:53:28 UTC
Hi FreeBSD hackers,
PostgreSQL's update_process_titles setting, which defaults to on,
slows busy databases down quite noticeably on FreeBSD and so a lot of
people turn it off. Having that information in ps/top/htop is nice,
so I don't like turning it off. It was a rainy Sunday here yesterday
so I decided to hack on that. I wrote an experimental patch,
attached, that essentially reverts to the ancient syscall-free BSD
behaviour (?) on a per-process basis, for processes that are
update-heavy. That raises some interesting questions about torn
reads, I admit...
I didn't see much difference in "pgbench" on my laptop, but on an AWS
m4.10xlarge (40 vCPU) machine I could easily see a difference. I
think there is probably a contention effect somewhere that gets worse
with more concurrency.
pgbench -i -s 10 postgres
pgbench -T60 -c 40 -j 40 -S -M prepared postgres
Stock 11.2, update_process_titles = on: 472873 TPS (default)
Stock 11.2, update_process_titles = off: 539391 TPS (~13% faster
than default)
Patched 11.2, update_process_titles = on: 519733 TPS (~10% faster
than default)
I'd be grateful for any feedback.
Thanks,
Thomas Munro
PostgreSQL's update_process_titles setting, which defaults to on,
slows busy databases down quite noticeably on FreeBSD and so a lot of
people turn it off. Having that information in ps/top/htop is nice,
so I don't like turning it off. It was a rainy Sunday here yesterday
so I decided to hack on that. I wrote an experimental patch,
attached, that essentially reverts to the ancient syscall-free BSD
behaviour (?) on a per-process basis, for processes that are
update-heavy. That raises some interesting questions about torn
reads, I admit...
I didn't see much difference in "pgbench" on my laptop, but on an AWS
m4.10xlarge (40 vCPU) machine I could easily see a difference. I
think there is probably a contention effect somewhere that gets worse
with more concurrency.
pgbench -i -s 10 postgres
pgbench -T60 -c 40 -j 40 -S -M prepared postgres
Stock 11.2, update_process_titles = on: 472873 TPS (default)
Stock 11.2, update_process_titles = off: 539391 TPS (~13% faster
than default)
Patched 11.2, update_process_titles = on: 519733 TPS (~10% faster
than default)
I'd be grateful for any feedback.
Thanks,
Thomas Munro