Postgres Server RAM vs SSD

I currently have a 15GB data file running on a dedicated server with 16GB RAM and a 2TB HHD.
RIght now, linux is saying I am using about 9% of my primary HHD.

I am considering moving the data to a new server and was wondering if there is much of a performance difference between these options:

32GB RAM with a 4TB HHD
16GB RAM with a 500GB SSD

I’m thinking if I have 32GB RAM then the entire data file can reside in RAM and there shouldn’t be much difference between an HHD and an SSD. I’m also thinking that it’s nice to have the extra disk space as the database grows.

However, even if the data file grows by 10GB a year (which is unlikely), in 10 years the data file would still be only 100GB or so - so maybe that is just me worrying for nothing.

Blockquote
However, even if the data file grows by 10GB a year (which is unlikely), in 10 years the data file would still be only 100GB or so - so maybe that is just me worrying for nothing.

That is what I was thinking :slight_smile:

I would not worry to much about this.

1 Like

Do you think the SSD would make much of a difference?

Under heavy loads maybe. But not that much.

The most important part when it comes to database, is the reliability, so a RAID based server is best IMO.

1 Like

Thanks!

The question with the RAM is always, if you will have it totally available for “your file”. That pretty much depends what is running on your server, and perhaps needs some finetuning.

Even for databases I have seen “tremendous” speed gain with an SSD, compared to HDD. But I’m with Per, nothing more important than stability, so it pretty much depends how good your hosting services are. I’m with upcloud.com. They have SSD only, and so far no issues whatsoever, other than a considerable gain of speed, even for database accesses.

some years ago, I had a mac mini server with i7 and 16GB ram. postgres database on it, relatively small 500KB. and an HDD. switching to SSD gave enormous more speed.
may be if you can fine tune the system all in ram and the database also may be
but today as the ssd prices are really low (I remember 1850€ for a 500GB samsung ssd 11 years ago…) you should not bother with any HDD. and also SSD are much more reliable than HDD (except may be for enterprise class HDD but you will pay that more than an SSD…)

4 Likes

and most important : don’t forget regular-automatic-backups !

1 Like

Thank you. I can always rent the SSD server for a month or so to see just how much of a difference there is in speed. I was mostly concerned about running out of space, but if the database today is only 15GB, a 500GB SSD should be safe for a while.

You betcha!!!

Another voice in favor of SSDs for database server. Huge difference in speed.

btw, there are special RAMs with storage battery for the usecase database in RAM.

Thank you.

If you are reading the db mostly, then it will fit in ram and hd speed not an issue. If there are many updates that must be committed then an ssd is gonna make a big difference

Why do you consider SSD to be safer? What is the technical background?

personnal experiments…
I replace hdd with ssd since around 2010, almost one each day within last years
less than five has come back for replacement
and almost all the hdd replacements for a ssd went to me because they were failing…
so I can assume ssd are at least 10x more fast, and 10x more reliable than hdd.

1 Like

Partly due to the lack of moving parts. I’m old enough to remember when “stiction” was a problem in HDD’s when the ball bearings in the motor were not properly lubricated. This led to lots of people recommending to NOT power down computers at night, because sometimes HDDs refused to start spinning again but would continue to spin if already spinning. (It also sometimes helped to tap gently on the HDD, to help it break free from “stiction” problems.)

Early SSDs had a lower tolerance to how many times they could WRITE a sector, so various scatter-load and usage balancing routines were introduced in the firmware. Newer SSDs have better reliabililty in this regard.

But ANY disk can fail, including SSD. For mission-critical, high availability stuff you really should be using a RAID approach that supports hot swap of a failed drive while the system is running. For cases where high availability is not as critical, you still want multiple backups including off-site to help mitigate natural disasters, fire, theft, etc.

1 Like