Re: [PERFORM] Tuning PostgreSQL

2003-07-22 Thread Vincent van Leeuwen
On 2003-07-22 09:04:42 +0200, Alexander Priem wrote:
 Hi all,
 
 Vincent, You said that using RAID1, you don't have real redundancy. But
 RAID1 is mirroring, right? So if one of the two disks should fail, there
 should be no data lost, right?
 

Right. But the proposal was a single disk for WAL, without redundancy, and I
argued that wasn't really safe. RAID1 by itself is extremely safe, possibly
even the safest RAID type there is.

 I have been thinking some more. 18Gb drives are cheaper than 36 or 72Gb
 drives. I don't know if I can get the money for this, but how would the
 following setup sound?
 
 Two 18Gb (15.000rpm) disks in RAID1 array for Operating System + WAL.
 Four 18Gb (15.000rpm) disks in RAID5 array for data.
 

Our own testing has shown that a 6 disk RAID-10 array is faster than what you
describe. Of course, this is very much dependant on how much INSERT/UPDATES
you generate (which taxes your WAL more), so your mileage may vary.

 For the same amount of money, I could also get:
 
 Two 36Gb (10.000rpm) disks in RAID1 array for Operating System + WAL.
 Five/Six 36Gb (10.000rpm) disks in RAID5 array for data.
 

It is said that a higher RPM is particularly useful for a WAL disk. So you
might consider using two 18GB 15K rpm drives for a RAID-1 WAL disk (+OS and
swap), and using 36GB 10K rpm disks in a RAID-5 array if you need that
diskspace.

 Which would be the best of the above? The one with four 15k-rpm disks or the
 one with five/six 10k-rpm disks?
 Would these configs be better than all disks in one huge RAID5 array? There
 are so many possible configs with RAID...
 

15K rpm disks are significantly faster than 10K rpm disks. If your only
concern is performance, buy 15K rpm disks. If you want more diskspace for your
money, fall back to larger 10K rpm disks.

I personally think seperate WAL disks are vastly overrated, since they haven't
shown a big performance gain in our own tests. But as I have said, this is
extremely dependant on the type of load you generate, so only your own tests
can tell you what you should do in this respect.

About RAID types: the fastest RAID type by far is RAID-10. However, this will
cost you a lot of useable diskspace, so it isn't for everyone. You need at
least 4 disks for a RAID-10 array. RAID-5 is a nice compromise if you want as
much useable diskspace as possible and still want to be redundant. RAID-1 is
very useful for small (2-disk) arrays.

If you have the time and are settled on buying 6 disks, I'd test the following
scenarios:
- 6-disk RAID-10 array (should perform best)
- 4-disk RAID-10 array containing data, 2-disk RAID-1 array for WAL, OS, etc
- 4-disk RAID-5 array containing data, 2-disk RAID-1 array for WAL, OS, etc
- 6-disk RAID-5 array (will probably perform worst)


Hope this helps.

Vincent van Leeuwen
Media Design - http://www.mediadesign.nl/

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PERFORM] Sanity check requested

2003-07-18 Thread Vincent van Leeuwen
On 2003-07-17 10:41:35 -0500, Nick Fankhauser wrote:
 I'm using ext2. For now, I'll leave this and the OS version alone. If I
 

I'd upgrade to a journaling filesystem as soon as possible for reliability.
Testing in our own environment has shown that PostgreSQL performs best on ext3
(yes, better than XFS, JFS or ReiserFS) with a linux 2.4.21 kernel. Be sure to
mount noatime and to create the ext3 partition with the correct stripe size of
your RAID array using the '-R stride=foo' option (see man mke2fs).

Vincent van Leeuwen
Media Design - http://www.mediadesign.nl/

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PERFORM] Sanity check requested

2003-07-18 Thread Vincent van Leeuwen
On 2003-07-18 18:20:55 +0200, Oliver Scheit wrote:
  Be sure to mount noatime 
 
 I did chattr -R +A /var/lib/pgsql/data
 that should do the trick as well or am I wrong?
 

According to the man page it gives the same effect. There are a few things you
should consider though:
- new files won't be created with the same options (I think), so you'll have
to run this command as a daily cronjob or something to that effect
- chattr is probably more filesystem-specific than a noatime mount, although
this isn't a problem on ext[23] ofcourse

Vincent van Leeuwen
Media Design - http://www.mediadesign.nl/

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PERFORM] Hardware performance

2003-07-17 Thread Vincent van Leeuwen
On 2003-07-16 19:57:22 -0700, Balazs Wellisch wrote:
 We're now stuck on the question of what type of RAID configuration to use
 for this server. RAID 5 offers the best fault tolerance but doesn't perform
 all that well. RAID 10 offers much better performance, but no hot swap. Or
 should we not use RAID at all. I know that ideally the log (WAL) files
 should reside on a separate disk from the rest of the DB. Should we use 4
 separate drives instead? One for the OS, one for data, one for WAL, one for
 swap? Or RAID 10 for everything plus 1 drive for WAL? Or RAID 5 for
 everything?
 

We have recently run our own test (simulating our own database load) on a new
server which contained 7 15K rpm disks. Since we always want to have a
hot-spare drive (servers are located in a hard-to-reach datacenter) and we
always want redundancy, we tested two different configurations:
- 6 disk RAID 10 array, holding everything
- 4 disk RAID 5 array holding postgresql data and 2 disk RAID 1 array holding
  OS, swap and WAL logs

Our database is used for a very busy community website, so our load contains a
lot of inserts/updates for a website, but much more selects than there are
updates.

Our findings were that the 6 disk RAID 10 set was significantly faster than
the other setup.

So I'd recommend a 4-disk RAID 10 array. I'd use the 5th drive for a hot-spare
drive, but that's your own call. However, it would be best if you tested some
different setups under your own database load to see what works best for you.


Vincent van Leeuwen
Media Design - http://www.mediadesign.nl/

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]