I’ve recently faced a situation where I had to ask myself, are ssd worth the price?
We are willing to upgrade our infrastructure and I took a look at the new dedicated servers offered by our hosting provider, OVH.
We used to have only SSD for our servers, but to reduce our hosting cost, I realized that SSD disks where ± 40 € more expensive.
So are they worth?
I had the basic assumption, which is still right anyway, that SSD are quicker, read and write access are really fast. I remember when I bought for myself, it was heaven.
But, in a distributed architecture where one service is ran by one server (or at least a virtual server in our proxmox cluster), are the disk access a real problem?
We are running several frontend, powered by Apache, on which our PHP application is processed. We use Symfony 2, and a lot of dependencies make the memory fingerprint high, as well as the number of file to load.
But, here is the key, we use an opcode cache, so most of the file executed by PHP is read from memory, which no disks access, at all (once the cache is warmed up, obviously).
Enough assumptions, let’s monitor and benchmark.
To have some numbers to play with, I used
iostat which is part of the
I also used
iotop which is like
top but sort by disk read/write.
To get sample of the read/write bandwidth I used
iotop in batch mode:
iotop -o -P -b -k -qqq | tr -d \[\]\- | tee -a iotop.log
-o means display only the process which either reads or writes,
-P groups all thread on under the same process,
-b starts the batch, non-interactive mode,
-qqq means quiet, quiet, quiet (do not return headers or summary).
tr is used to clean a bit the output, and tee to both display and write to a file.
After a given time, we can start to analyse data. I used
awk for this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
This has been sampled for around 3 hours, so given the apache results it’s an average of 12 mb/h, 170 kb/m and 2.83 kb/s.
I also used inotifywatch to determine the number of read/write access and compute the average number of access to the filesystem.
That’s not much, in comparison, our mysql databases results