Re: Tuning guidelines for server with 256GB of RAM and SSDs?

From: "Wes Vaske (wvaske)" <wvaske(at)micron(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>, Kaixi Luo <kaixiluo(at)gmail(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Tuning guidelines for server with 256GB of RAM and SSDs?
Date: 2016-07-06 22:34:12
Message-ID: 1467844446520.50691@micron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Regarding the Nordeus blog Merlin linked.

They say:
"This doesn't mean the data was really written to disk, it can still remain in the disk cache, but enterprise drives usually make sure the data was really written to disk on fsync calls."

This isn't actually true for enterprise drives (when I say enterprise in the context of an SSD, I'm assuming full power loss protection via capacitors on the drive like the Intel DC S3x00 series). Most enterprise SSDs will ignore calls to disable disk cache or to flush the disk cache as doing so is entirely unnecessary.

Regarding write back cache:
Disabling the write back cache won't have a real large impact on the endurance of the drive unless it reduces the total number of bytes written (which it won't). I've seen drives that perform better with it disabled and drives that perform better with it enabled. I would test in your environment and make the decision based on performance.

Regarding the Crucial drive for logs:
As far as I'm aware, none of the Crucial drives have power loss protection. To use these drives you would want to disable disk cache which would drop your performance a fair bit.

Write amplification:
I wouldn't expect write amplification to be a serious issue unless you hit every LBA on the device early in its life and never execute TRIM. This is one of the reasons software RAID can be a better solution for something like this. MDADM supports TRIM in RAID devices. So unless you run the drives above 90% full, the write amplification would be minimal so long as you have a daily fstrim cron job.

Wes Vaske | Senior Storage Solutions Engineer
Micron Technology

________________________________________
From: pgsql-performance-owner(at)postgresql(dot)org <pgsql-performance-owner(at)postgresql(dot)org> on behalf of Merlin Moncure <mmoncure(at)gmail(dot)com>
Sent: Wednesday, July 6, 2016 1:13 PM
To: Kaixi Luo
Cc: postgres performance list
Subject: Re: [PERFORM] Tuning guidelines for server with 256GB of RAM and SSDs?

On Tue, Jul 5, 2016 at 9:50 AM, Kaixi Luo <kaixiluo(at)gmail(dot)com> wrote:
> Hello,
>
> I've been reading Mr. Greg Smith's "Postgres 9.0 - High Performance" book
> and I have some questions regarding the guidelines I found in the book,
> because I suspect some of them can't be followed blindly to the letter on a
> server with lots of RAM and SSDs.
>
> Here are my server specs:
>
> Intel Xeon E5-1650 v3 Hexa-Core Haswell
> 256GB DDR4 ECC RAM
> Battery backed hardware RAID with 512MB of WriteBack cache (LSI MegaRAID SAS
> 9260-4i)
> RAID1 - 2x480GB Samsung SSD with power loss protection (will be used to
> store the PostgreSQL database)
> RAID1 - 2x240GB Crucial SSD with power loss protection. (will be used to
> store PostgreSQL transactions logs)
>
> First of all, the book suggests that I should enable the WriteBack cache of
> the HWRAID and disable the disk cache to increase performance and ensure
> data safety. Is it still advisable to do this on SSDs, specifically the step
> of disabling the disk cache? Wouldn't that increase the wear rate of the
> SSD?

At the time that book was written, the majority of SSDs were known not
to be completely honest and/or reliable about data integrity in the
face of a power event. Now it's a hit or miss situation (for example,
see here: http://blog.nordeus.com/dev-ops/power-failure-testing-with-ssds.htm)
The intel drives S3500/S3700 and their descendants are the standard
against which other drives should be judged IMO. The S3500 family in
particular offers tremendous value for database usage. Do your
research; the warning is still relevant but the blanket statement no
longer applies. Spinning drives are completely obsolete for database
applications in my experience.

Disabling write back cache for write heavy database loads will will
destroy it in short order due to write amplication and will generally
cause it to underperform hard drives in my experience.

With good SSDs and a good motherboard, I do not recommend a caching
raid controller; software raid is a better choice for many reasons.

One parameter that needs to be analyzed with SSD is
effective_io_concurrency. see
https://www.postgresql.org/message-id/CAHyXU0yiVvfQAnR9cyH%3DHWh1WbLRsioe%3DmzRJTHwtr%3D2azsTdQ%40mail.gmail.com

merlin

--
Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2016-07-07 04:59:46 Re: Tuning guidelines for server with 256GB of RAM and SSDs?
Previous Message Scott Marlowe 2016-07-06 21:48:36 Re: Tuning guidelines for server with 256GB of RAM and SSDs?