Thread: Best hardware/cost tradoff?

Best hardware/cost tradoff?

From
cluster
Date:
I'm about to buy a combined web- and database server. When (if) the site
gets sufficiently popular, we will split the database out to a separate
server.

Our budget is limited, so how should we prioritize?

* We think about buying some HP Proliant server with at least 4GB ram
and at least a duo core processor. Possibly quad core. The OS will be
debian/Linux.

* Much of the database will fit in RAM so it is not *that* necessary to
prefer the more expensive SAS 10000 RPM drives to the cheaper 7500 RPM
SATA drives, is it? There will both be many read- and write queries and
a *lot* (!) of random reads.

* I think we will go for hardware-based RAID 1 with a good
battery-backed-up controller. I have read that software RAID perform
surprisingly good, but for a production site where hotplug replacement
of dead disks is required, is software RAID still worth it?

Anything else we should be aware of?

Thanks!

Re: Best hardware/cost tradoff?

From
"Scott Marlowe"
Date:
On Thu, Aug 28, 2008 at 1:22 PM, cluster <skrald@amossen.dk> wrote:
> I'm about to buy a combined web- and database server. When (if) the site
> gets sufficiently popular, we will split the database out to a separate
> server.
>
> Our budget is limited, so how should we prioritize?

Standard prioritization for a db server is:  Disks and controller, RAM, CPU.

> * We think about buying some HP Proliant server with at least 4GB ram and at
> least a duo core processor. Possibly quad core. The OS will be debian/Linux.

HP Makes nice equipment.  Also, since this machine will have apache as
well as pgsql running on it, you might want to look at more memory if
it's reasonably priced.  If pg and apache are using 1.5Gig total to
run, you've got 2.5Gig for the OS to cache in.  With 8 Gig of ram,
you'd have 6.5Gig to cache in.  Also, the cost of a quad core nowadays
is pretty reasonable.

> * Much of the database will fit in RAM so it is not *that* necessary to
> prefer the more expensive SAS 10000 RPM drives to the cheaper 7500 RPM SATA
> drives, is it?

That depends.  Writes will still have to hit the drives.  Reads will
be mostly from memory.  Be sure to set your effective_cache_size
appropriately.

> There will both be many read- and write queries and a *lot*
> (!) of random reads.
>
> * I think we will go for hardware-based RAID 1 with a good battery-backed-up
> controller.

The HP RAID controller that's been mentioned on the list seems like a
good performer.

> I have read that software RAID perform surprisingly good, but
> for a production site where hotplug replacement of dead disks is required,
> is software RAID still worth it?

The answre is maybe.  The reason people keep testing software RAID is
that a lot of cheap (not necessarily in cost, just in design)
controllers give mediocre performance compared to SW RAID.

With SW RAID on top of a caching controller in jbod mode, the
controller simply becomes a cache that can survive power loss, and
doesn't have to do any RAID calculations any more.  With today's very
fast CPUs, and often running RAID-10 for dbs, which requires little
real overhead, it's not uncommon for SW RAID to outrun HW.

With better controllers, the advantage is small to none.

> Anything else we should be aware of?

Can you go with 4 drives?  Even if they're just SATA drives, you'd be
amazed at what going from a 2 drive mirror to a 4 drive RAID-10 can do
for your performance.  Note you'll have no more storage going from 2
drive mirror to 4 drive RAID-10, but your aggregate bandwidth on reads
will be doubled.

Re: Best hardware/cost tradoff?

From
"Fernando Hevia"
Date:

> -----Mensaje original-----
> De: pgsql-performance-owner@postgresql.org
> [mailto:pgsql-performance-owner@postgresql.org] En nombre de cluster
>
> I'm about to buy a combined web- and database server. When
> (if) the site gets sufficiently popular, we will split the
> database out to a separate server.
>
> Our budget is limited, so how should we prioritize?
>
> * We think about buying some HP Proliant server with at least
> 4GB ram and at least a duo core processor. Possibly quad
> core. The OS will be debian/Linux.
>
> * Much of the database will fit in RAM so it is not *that*
> necessary to prefer the more expensive SAS 10000 RPM drives
> to the cheaper 7500 RPM SATA drives, is it? There will both
> be many read- and write queries and a *lot* (!) of random reads.
>
> * I think we will go for hardware-based RAID 1 with a good
> battery-backed-up controller. I have read that software RAID
> perform surprisingly good, but for a production site where
> hotplug replacement of dead disks is required, is software
> RAID still worth it?
>
> Anything else we should be aware of?
>

I havent had any issues with software raid (mdadm) and hot-swaps. It keeps
working in degraded mode and as soon as you replace the defective disk it
can reconstruct the array on the fly. Performance will suffer while at it
but the service keeps up.
The battery backup makes a very strong point for a hw controller. Still, I
have heard good things on combining a HW controller with JBODS leaving the
RAID affair to mdadm. In your scenario though with "*lots* of random reads",
if I had to choose between a HW controller & 2 disks or software RAID with 4
or 6 disks, I would go for the disks. There are motherboards with 6 SATA
ports. For the money you will save on the controller you can afford 6 disks
in a RAID 10 setup.

Cheers,
Fernando.


Re: Best hardware/cost tradoff?

From
Craig James
Date:
>> -----Mensaje original-----
>> De: pgsql-performance-owner@postgresql.org
>> * I think we will go for hardware-based RAID 1 with a good
>> battery-backed-up controller. I have read that software RAID
>> perform surprisingly good, but for a production site where
>> hotplug replacement of dead disks is required, is software
>> RAID still worth it?
>> ...
> I havent had any issues with software raid (mdadm) and hot-swaps. It keeps
> working in degraded mode and as soon as you replace the defective disk it
> can reconstruct the array on the fly. Performance will suffer while at it
> but the service keeps up.
> The battery backup makes a very strong point for a hw controller. Still, I
> have heard good things on combining a HW controller with JBODS leaving the
> RAID affair to mdadm. In your scenario though with "*lots* of random reads",
> if I had to choose between a HW controller & 2 disks or software RAID with 4
> or 6 disks, I would go for the disks. There are motherboards with 6 SATA
> ports. For the money you will save on the controller you can afford 6 disks
> in a RAID 10 setup.

This is good advice.  Hot-swapping seems cool, but how often will you actually use it? Maybe once every year?  With
SoftwareRAID, replacing a disk means shutdown, swap the hardware, and reboot, which is usually less than ten minutes,
andyou're back in business.  If that's the only thing that happens, you'll have 99.97% uptime on your server. 

If you're on a limited budget, a software RAID 1+0 will be very cost effective and give good performance for lots of
randomreads.  Hardware RAID with a battery-backed cache helps with writes and hot swapping.  If your random-read
performanceneeds outweigh these two factors, consider software RAID. 

Craig


Re: Best hardware/cost tradoff?

From
cluster
Date:
Thanks for all your replies! They are enlightening. I have some
additional questions:

1) Would you prefer
    a) 5.4k 2" SATA RAID10 on four disks or
    b) 10k 2" SAS RAID1 on two disks?
(Remember the lots (!) of random reads)

2) Should I just make one large partition of my RAID? Does it matter at all?

3) Will I gain much by putting the OS on a saparate disk, not included
in the RAID? (The webserver and database would still share the RAID -
but I guess the OS will cache my (small) web content in RAM anyway).

Thanks again!

Re: Best hardware/cost tradoff?

From
"Scott Marlowe"
Date:
On Thu, Aug 28, 2008 at 2:04 PM, Fernando Hevia <fhevia@ip-tel.com.ar> wrote:
>
> I havent had any issues with software raid (mdadm) and hot-swaps. It keeps
> working in degraded mode and as soon as you replace the defective disk it
> can reconstruct the array on the fly. Performance will suffer while at it
> but the service keeps up.

I too put my vote behind mdadm for ease of use.  However, there are
reports that certain levels of RAID in linux kernel RAID that are
supposed to NOT handle write barriers properly.  So that's what
worries me.

> The battery backup makes a very strong point for a hw controller. Still, I
> have heard good things on combining a HW controller with JBODS leaving the
> RAID affair to mdadm. In your scenario though with "*lots* of random reads",

This is especially true on slower RAID controllers.  A lot of RAID
controllers in the $300 range with battery backed caching don't do
RAID real well, but do caching ok.  If you can't afford a $1200 RAID
card then this might be a good option.

Re: Best hardware/cost tradoff?

From
"Scott Marlowe"
Date:
On Thu, Aug 28, 2008 at 3:29 PM, cluster <skrald@amossen.dk> wrote:
> Thanks for all your replies! They are enlightening. I have some additional
> questions:
>
> 1) Would you prefer
>   a) 5.4k 2" SATA RAID10 on four disks or
>   b) 10k 2" SAS RAID1 on two disks?
> (Remember the lots (!) of random reads)

I'd lean towards 4 disks in RAID-10.  Better performance when > 1 read
is going on.  Similar commit rates to the two 10k drives.  Probably
bigger drives too, right?  Always nice to have room to work in.

> 2) Should I just make one large partition of my RAID? Does it matter at all?

Probably.  With more disks it might be advantageous to split out two
drives into RAID-10 for pg_xlog.  with 2 or 4 disks, splitting off two
for pg_xlog might slow down the data partition more than you gain from
a separate pg_xlog drive set.

> 3) Will I gain much by putting the OS on a saparate disk, not included in
> the RAID? (The webserver and database would still share the RAID - but I
> guess the OS will cache my (small) web content in RAM anyway).

The real reason you want your OS on a different set of drives is that
it allows you to reconfigure your underlying RAID array as needed
without having to reinstall the whole OS again.  Yeah, logging to
/var/log will eat some bandwidth on your RAID as well, but the ease of
maintenance is why I do it as much as anything.  A lot of large
servers support 2 fixed drives for the OS and a lot of removeable
drives hooked up to a RAID controller for this reason.

Re: Best hardware/cost tradoff?

From
cluster
Date:
We are now leaning towards just buying 4 SAS disks.

So should I just make one large RAID-10 partition or make two RAID-1's
having the log on one RAID and everything else on the second RAID?
How can I get the best read/write performance out of these four disks?
(Remember, that it is a combined web-/database server).

Re: Best hardware/cost tradoff?

From
"Fernando Hevia"
Date:

> -----Mensaje original-----
> De: pgsql-performance-owner@postgresql.org
> [mailto:pgsql-performance-owner@postgresql.org] En nombre de cluster
> Enviado el: Sábado, 30 de Agosto de 2008 07:21
> Para: pgsql-performance@postgresql.org
> Asunto: Re: [PERFORM] Best hardware/cost tradoff?
>
> We are now leaning towards just buying 4 SAS disks.
>
> So should I just make one large RAID-10 partition or make two
> RAID-1's having the log on one RAID and everything else on
> the second RAID?
> How can I get the best read/write performance out of these four disks?
> (Remember, that it is a combined web-/database server).
>

Make a single RAID 10. It´s simpler and it will provide you better write
performance which is where your bottleneck will be. I think you should
minimize the web server role in this equation as it should mostly work on
cached data.