Moving databases on ssd?

i find it verry informative, its all there


especialy the random 4kiops count for the dbs, my guess.

  • you can verify the test with different test sizes, i did, and it matched.

Many distributions have a gui tool for partitions (GParted). i think ext4 (4k cluster) for linux is ok.

2 Likes

I’m interested in how this turns out. I’ve had good experiences using USB flash drives to move occasional batches of large media files around (so occasional large sequential writes). I’ve had poor experiences using them as general filesystems with constant small writes (like node logs or a database). They just seemed to wear out: throwing errors, then the system drops them entirely or remounts them read-only.

But I can’t comment on any particular make or model: perhaps that Samsung has great write endurance.

1 Like

many of them are pre-formated in exfat for compatibility. with a big cluster size, resulting in wearing out quick in normal operation.
sd-cards have that problem usualy too.
flash-drives are not usb-sticks per se, they have an own controler.
also great quality differences can occur.

With 600MB of databases and 128GB of space, you get at least 200 complete rewrites of the databases. Multiply that by the number of times the entire stick can be rewritten. I believe we are safe for at least 10 years, if the controller dosen’t fail.

1 Like

This is not exactly true due to write amplification. A single 4kB write to a flash drive may trigger a rewrite of a full flash memory’s erase block, apparently even megabytes depending on the flash memory’s controller. It then pays off to get a quality drive with a good controller.

1 Like

I installed the USB stick (Samsung Bar Plus 128GB) in Synology, to move the databases on it, I formatted it as ext4, and there is an option, disabled by default: “enable delayed allocation for ext4 - …can improve write performance, but might result in data loss…”.
What is this and should I enable it?

https://ext4.wiki.kernel.org/index.php/Frequently_Asked_Questions#What_is_delayed_allocation_.28delalloc.29.3F_What_are_its_advantages_in_Ext4.3F

1 Like

I have UPS and db-es are not critical, so I’ll set it to enabled. I started non lazzy FW to see if USB makes any difference for it.

2 Likes

Test results here for the USB stick:
https://forum.storj.io/t/tuning-the-filewalker/19203/221?u=snorkel

1 Like

If you are on Synology, you should set noatime for the USB drive too.
You can use a script to run as root, at boot:

mount -o remount,noatime "/volumeUSB1/usbshare"

where /volumeUSB1/usbshare is the mount point that you get with sudo mount command.

Setting up my Ubuntu Server, I just learned about mount and the device names that are changing, and yes, it is recommended to use UUID for mount, but for my Synologys, I only use 1 USB port for the flash drive, the front one. The back one is linked to UPS. So, I doubt that the device name will change after reboots or even if I change an HDD.