Re: WAL write of full pages
От | Marty Scholes |
---|---|
Тема | Re: WAL write of full pages |
Дата | |
Msg-id | 405724E3.3010902@outputservices.com обсуждение исходный текст |
Ответ на | WAL write of full pages (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-hackers |
You are correct, modern drives are much faster than this, for big, cacheable writes. Try compiling and running the following code and watching your disk I/O. Than, comment out the fsync(), which will make the writes cacheable. Notice the huge difference. It is an multiple of 15 difference on my machine. #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main() { int i; char buf[8192]; int ld; unlink("dump.out"); ld=open("dump.out", O_WRONLY | O_CREAT); for (i=0; i<65536; i++) { write(ld, buf, sizeof(buf)); fsync(ld); } close(ld); return 0; } Manfred Spraul wrote: > Marty Scholes wrote: > >> >> 2. Put them on an actual (or mirrored actual) spindle >> Pros: >> * Keeps WAL and data file I/O separate >> Cons: >> * All of the non array drives are still slower than the array > > > Are you sure this is a problem? The dbt-2 benchmarks from osdl run on an > 8-way Intel computer with several raid arrays distributed to 40 disks. > IIRC it generates around 1.5 MB wal logs per second - well withing the > capability of a single drive. My laptop can write around 10 MB/sec > (measured with dd if=/dev/zero of=fill and vmstat), fast drives should > be above 20 MB/sec. > How much wal data is generated by large postgres setups? Are there any > setups that are limited by the wal logs. > > -- > Manfred > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org
В списке pgsql-hackers по дате отправления: