Boris Guéry

Hacking the web since 1997.

Are SSD Really Worth?

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 sar and iostat which is part of the sysstat suit. 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
awk '
BEGIN {
    printf "\nprocess\t\tread\t\twrite\n"
}
{
    process=$12;
    kb_read=$4;
    kb_write=$6;
    read[process]  += kb_read;
    write[process] += kb_write;
    l = length(process);
    m = m < l ? l : m;
}
END {
    for (process in read) {
        printf "%s%*s\t%.2f\t\t%.2f\n", process, m - length(process), "", read[process], write[process];
    }
}' iotop.log | sort -V -r -k 3

Sample result:

process read write
apache2 9954.10 36519.83
kjournald 7.79 27237.70
tee 3.90 2047.48
rrdcached 23.40 2016.19
rsyslogd 0.00 1977.26
puppet 0.00 70.19
vi 0.00 11.69
smtp 0.00 7.79
cleanup 0.00 7.79
qmgr 0.00 0.00
named 19.51 0.00
bash 19.51 0.00

(in kb/s)

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

Comments