jezahost
  • nvme
  • firmware
  • storage
  • debugging

Same disk, a fivefold difference in speed. How we updated NVMe firmware without stopping the servers

Of two identical installs, one finished in 70 seconds and the other in four and a half minutes. The cause turned out to be old firmware on the disks. How we found it and how we updated it without switching off customer servers.

It was the platform's first months. Two new servers were being set up. Both were the same size, in both about 27.7 GB of data was being copied to a new disk, and the network path was the same too. One finished in 70 seconds. The other took four and a half minutes.

The slow install went over our automation's time limit and created a half-finished server. This post is the story of the investigation that started from that half-finished server.

What we saw first

The only difference between the two installs was the target disk. Data was being written to the fast disk at 330–540 MB per second, and to the slow one at about 120 MB. The model of the disks was the same, the capacity was the same, the servers were the same.

We looked at the last seven days in the monitoring graphs. The picture was clear, some of the disks had never written above 248–420 MB per second, while the others reached 660–1109 MB. The only thing separating the two groups was the firmware version, the first release on the slow ones, a later version on the fast ones.

What we ruled out

Before blaming the firmware we checked the simpler causes.

The first was the link. All the disks were running on the same fast PCIe link, and the ceiling of that link was many times higher than the numbers we were seeing. So the bottleneck was not there.

The second was the health of the disk itself. Under ordinary load the disks answered requests in 0.18–0.30 milliseconds. The disk was not sluggish, it just hit a ceiling when a lot of data had to be written at once.

Who really owns the disk

To update the firmware we had to know where to get it from. The disk's model string did not say, it read only "3.2TB NVMe Gen4 U.2 SSD".

For server disks this is normal. Such disks are often built on one company's chip but released to another company's order and with that company's firmware, and the model string carries no brand name. So to find out who publishes the firmware, you have to look at the disk's own data.

We first looked in the server manufacturer's official firmware package and on the chip manufacturer's site. This disk was in neither.

The answer was in two separate fields in the information the disk reports about itself. The first (vid) shows who manufactured the chip inside the disk. The second (ssvid) shows which company the disk was released to the order of, and with whose firmware. On our disk these two fields pointed to different companies, and the firmware was published by the second one.

On that company's official support site there was a latest version for this disk. In the changelog, next to one of the versions in between, there is the note "write speed improvement". Our slow disks were on the very first release.

Updating without stopping

Now the question was this, can the firmware of a disk with customer servers running on it be changed without switching the server off?

Many NVMe disks support this, but not all. We checked three things on the disk, does it accept a firmware download, how many firmware slots does it have, and can it bring new firmware into use without a restart. The answers were positive, three slots, the first one is writable, activation without reset is supported.

The update consists of two commands.

nvme fw-download /dev/nvmeX --fw=<file>
nvme fw-commit /dev/nvmeX -s 1 -a 3

The first loads the file onto the disk, the second writes it to the first slot and brings it into use immediately.

We updated the disks one by one. Each took a few seconds. After each disk we stopped and looked at the storage's fault list, and moved on to the next one only when the list was empty. The customer servers were running the whole time; none of them stopped.

At the end we deliberately restarted one server, we moved the virtual servers on it elsewhere, switched it off and on, and moved them back. The aim was to see that the new firmware stays in place after a restart too. The disk came up on the new firmware.

The result and one honest note

After the update we ran a direct write test of 16 GiB on those disks, 1.3–1.4 GB per second. On the disks that had been on the first release, this means roughly a fivefold increase. The disks on the later version were already writing close to 1.1 GB anyway; the gain on them is small.

There is one thing we have to say openly here, the "before" and "after" numbers were not measured by the same method. The earlier numbers are taken from the monitoring graphs of live load, while the later ones are from a separate write test. So "fivefold" is an approximate figure, not a precise measurement. But the difference is big enough to leave no doubt that the disks became much faster.

What we learned

The name on the disk, and even the manufacturer of the chip inside it, does not tell you who you should get the firmware from. The ssvid field tells you that. If you look at ssvid first, the search takes a few minutes.

The server manufacturer's firmware package does not cover all the disks in the server. A disk released for another manufacturer will not be in it, and you will not see any warning either.

Updating without stopping does not suit every disk. Another type of disk in our servers of the same model has only one firmware slot and does not support activation without reset. For those the server has to be emptied and restarted.

Problems also have to be separated from one another. In those days one of the disks kept losing power and was connecting at half speed. First we tied that to the firmware too, then we blamed the disk. The real cause turned out to be a faulty bay in the chassis, a new disk came up at full speed in another bay. Two separate faults had overlapped at the same time and were hiding each other.

And the most important thing is this, no error showed this problem. The disks were "healthy", they were just running five times slower than they could. What led us to find it was two identical jobs finishing in different times.