I also implemented a quick and dirty version for a merge log based on
sharing a file handle (append mode + sprintf + fputs).
I tried the "append + per-thread 2KB buffered sprintf + fputs when full",
with the same number of runs. The logs are out of order by chunks, the
overhead seems higher with 1 thread, but there is no extra overhead
with 12 threads.
The results are as follow:
* 1 thread 33 runs median tps (average is consistent):
- no logging: 22062
- separate logging: 19360 (-12.2%)
- merged logging: 19326 (-12.4%, not significant from previous)
- buf merged logging: 18751 (-15%, seems significant)
The worst overhead I could trigger is with 12 threads:
* 12 threads 35 runs median tps (average is consistent)
- no logging: 155917
- separate logging: 124695 (-20.0%)
- merged logging: 119349 (-23.5%)
- buf merged logging: 124914 (-19.9%, not significant from separate)
--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers