PostgreSQL Soft RAID 1

Поиск
Список
Период
Сортировка
Искать

PostgreSQL Soft RAID 1

От:
Pailloncy Jean-Gerard <jg@rilk.com>
Дата:
Hi,

I had this idea, after reading some of the code about storage manager.
There was in the past, other software manager in very old version of 
PostgreSQL.
I do not want to bring to life the old system, but I get one idea about 
to speed things with special soft raid 1 in PostgreSQL.

For simplicity, I did not consider the caching of the RAID controller 
or of the disk.

I consider the case where the database is larger than the RAM.
When there is many queries runing, the main bootleneck is the disk.
A modern drive reading fully randomly: the drive may sustain few (X) 
megabytes/second of data transfer. A seq reading: few (Y) hundred 
megabytes/second.
With a hardware RAID1 I should able to get twice (2X) the speed for 
random read.

The query may do "random read", "seq read" or "write" operations.

If the RAID1 was done by PostgreSQL, the random queries could be 
redirect to the first drive (speed X) and the seq queries partially 
serialized to the second drive (speed Y >> X).
In the same way when bgwriter works, it mays write sequentially to one 
drive and then to the other.

A hardware RAID1 when there is a mix a random and seq scan, just do 
random (speed = 2X).
Intelligent read in soft RAID may achieve the speed Y+X >> 2X MB/s.

I said partially serialized seq queries because if there are many seq 
scan on the same drive, the drive will do random. So we need to 
partially serialized operations so that big chunks of data are read 
together.

There is many other idea readv/writev, DIRECT_IO, Scatter/Gather I/O, 
too.

Cordialement,
Jean-Gérard Pailloncy

FAQ