Forum Moderators: phranque

Message Too Old, No Replies

Comparing a VPS with SSD to HDD

         

csdude55

12:35 am on Nov 20, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As I'm getting quotes for a new VPS, I'm running in to options of an SSD vs HDD. My current VPS uses an SSD and I recognize the difference in read/write times and reliability, so I really don't want to go back to an HDD. But for the sake of money, I'm considering setting up a smaller SSD and a second, larger HDD.

The question is, what should go on which?

Most of my sites use PHP and Perl, and I assume these should be on the SSD since they're executable. I also have MySQL, which I also think should be on SSD for the same reason.

I have user-uploaded images, and eventually videos. These will be loaded on the website, but if I lazy-load then I kinda think that a slower read/write time with them on an HDD wouldn't be noticeable?

What about emails and low-activity websites?

I'm thinking that I could put all of the low-activity client sites that I host, all of the emails, and the user-uploaded images and videos on the HDD. And then just put my high-activity site's PHP scripts, Perl, and MySQL on the SSD. If I did that then I could get a 60G SSD with a separate 500G HDD for roughly the same price as a 200G SSD.

robzilla

3:41 pm on Nov 20, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sounds like a nuisance to me. You'll have to mount the HDD separately and split the storage of files between the drives. That makes your set-up more complex, and an extra drive is an extra point of failure. But if you do go down this road, I'd say e-mail would be a good candidate for slower storage.

If you're only using 90 GB of disk space, as I recall from the previous thread, I don't see any benefit in going hybrid.

if I lazy-load then I kinda think that a slower read/write time with them on an HDD wouldn't be noticeable?

If the images start loading when they come into view, then in theory that will be more noticeable if they come from spinning rust.

Dimitri

10:38 pm on Nov 20, 2020 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



It depends of the amount of RAM and if your server has lot of disk write operations, or I should say DB writing operations.

The OS is caching frequently accessed (read) files in memory.

If you configured your MySQL correctly, indexes / keys will be stored in memory too, as well as frequently accessed data and queries. You can see the cache hit rate by checking the MySQL stats.

As for PHP it really doesn't matter if it's on a SSD or HD because the op code is cached in memory. So only the first access to a php file is read from the disk, PHP will generate the op code, and store it in memory. Next calls, will directly access the op code from the RAM.

csdude55

11:21 pm on Nov 20, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



@robzilla, I'm currently using 91G of my 99G SSD, but it's always growing because I allow users to upload pics. I'm also hoping to let them upload videos once I get to the new server, so I'll eventually need a lot more storage.

And, of course, I have 3 hosted clients that have a butt-load of emails on the server and refuse to download them.

So I'll definitely need at least 200G in storage on the new server, but since I could get a lot more for the same money with a slower drive, it was tempting...

It depends of the amount of RAM and if your server has lot of disk write operations, or I should say DB writing operations.

@Dimitri, my current server shows that I have /dev/xvda1, /dev/xvda2, and /dev/xvdc, but Munin shows xvda, xvdb, and xvdc! I'm taking a wild guess that xvda2 is xvdb? I know that xvda2 is the one that's using most of my storage, so that's definitely where /home/ is.

Either way, Munin shows:

Disk IOs per device
xvda:
Min: 188.44m / 24.99
Avg: 3.08 / 45.25
Max: 99.88 / 263.58

xvdb:
Min: 0.00 / 0.00
Avg: 40.43m / 37.39m
Max: 1.15 / 4.62

xvdc:
Min: 0.00 / 0.00
Avg: 25.00u /0.76m
Max: 3.31m / 102.91m


Disk throughput
xvda:
Min: 1.16k / 108.34k
Avg: 31.40k / 205.98k
Max: 1.02M / 2.40M

xvdb:
Min: 0.00 / 0.00
Avg: 165.59 / 155.63
Max: 4.58k / 18.78k

xvdc:
Min: 0.00 / 0.00
Avg: 104.86m / 125.99
Max: 13.56 / 421.53


and then MySQL:

MySQL queries
cache_hits:
Min: 5.35
Avg: 14.10
Max: 24.53

total:
Min: 12.58
Avg: 38.50
Max: 69.86


Does that help any? If so, does it make you think that I would be better off with a 200G SSD than a hybrid SSD / HDD?