You paid for NVMe storage. You're still waiting on I/O.
That gap between advertised throughput and real-world speed usually traces back to nine predictable mistakes. I've walked through hundreds of slow VPS tickets, and these same issues appear in about 80% of them. Let's fix them.
Mistake 1: Running ext4 Without the discard Option
NVMe drives need TRIM commands to maintain write performance over time. Most providers format your VPS with ext4, but many skip the discard mount option that enables continuous TRIM.
Check your current mount options:
mount | grep ' / '
If you don't see discard in the output, your filesystem isn't telling the SSD which blocks are free. Write amplification builds up. Performance drops after a few weeks of use.
Add it to /etc/fstab:
UUID=your-uuid / ext4 defaults,discard 0 1
Then remount:
sudo mount -o remount /
For older kernels or certain RAID configurations, discard can cause stalls. In those cases, schedule periodic fstrim instead:
sudo systemctl enable fstrim.timer
Mistake 2: Using the Wrong I/O Scheduler
Linux ships with multiple I/O schedulers. Most distributions default to mq-deadline or bfq, which add latency optimizations designed for spinning disks. NVMe doesn't need those queues.
Check your current scheduler:
cat /sys/block/nvme0n1/queue/scheduler
You'll see something like [mq-deadline] none kyber bfq. The brackets show what's active.
Switch to none for NVMe:
echo none | sudo tee /sys/block/nvme0n1/queue/scheduler
Make it permanent by creating /etc/udev/rules.d/60-ioschedulers.rules:
ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none"
The none scheduler (also called "noop" in older kernels) skips reordering entirely. NVMe controllers handle queue optimization in hardware. Software schedulers just add overhead.
Mistake 3: Ignoring vm.swappiness on Memory-Light Plans
Swappiness controls how aggressively Linux swaps memory to disk. The default value of 60 makes sense for desktops. On a VPS with 2-4 GB of RAM running web services, it causes constant tiny writes that NVMe handles fast enough you don't notice in latency graphs — but you'll see it in IOPS exhaustion.
Check your current setting:
cat /proc/sys/vm/swappiness
For most web hosting workloads, drop it to 10:
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
This tells the kernel to keep data in RAM until it's truly necessary to swap. You'll preserve IOPS budget for actual application writes.
Mistake 4: Running MySQL/MariaDB With Default InnoDB Settings
The InnoDB defaults were written for servers with spinning disks. They're overly conservative about flush behavior.
Two settings kill NVMe performance:
innodb_flush_log_at_trx_commit=1forces a sync to disk after every transactioninnodb_flush_method=fsyncuses a flush method that doesn't take advantage of NVMe write caching
Edit /etc/mysql/my.cnf or /etc/my.cnf.d/server.cnf:
[mysqld]
innodb_flush_log_at_trx_commit=2
innodb_flush_method=O_DIRECT
innodb_io_capacity=2000
innodb_io_capacity_max=4000
innodb_flush_log_at_trx_commit=2 writes to the OS cache every commit and flushes to disk every second. You risk one second of transactions in a crash, but typical web apps can tolerate that. If you can't, keep it at 1 but fix the other settings.
O_DIRECT bypasses the OS page cache for data files, preventing double-buffering. NVMe is fast enough that the cache just adds latency.
Restart MySQL and watch your query times drop.
Mistake 5: Skipping Filesystem Alignment Checks
Partition misalignment adds overhead to every I/O operation. If your partition doesn't start on a 1 MiB boundary, the filesystem may split writes across multiple NVMe pages.
Check alignment:
sudo parted /dev/nvme0n1 align-check opt 1
If it says "not aligned," you're taking a performance hit. Realigning requires repartitioning, which means backup and restore.
When provisioning a new VPS, most providers align automatically. But older images and manual partitioning can create misalignment. If you're migrating from an older VPS or restoring from a physical server backup, verify alignment before you go live.
So what if the kernel settings look right but performance still lags?
Check your actual queue depth settings. NVMe supports deep queues — 64K commands or more. If your kernel limits queue depth artificially, you're not using the hardware.
Mistake 6: Limiting Queue Depth With nr_requests
The nr_requests parameter caps how many I/O requests the kernel queues before blocking. The default is often 128, which was fine for SATA. NVMe can handle far more.
Check current settings:
cat /sys/block/nvme0n1/queue/nr_requests
Raise it:
echo 1024 | sudo tee /sys/block/nvme0n1/queue/nr_requests
For database servers or other high-concurrency workloads, you can go higher — 2048 or 4096. Watch your memory, though. Each queued request consumes kernel memory.
Mistake 7: Not Tuning Read-Ahead
Read-ahead prefetches data the kernel thinks you'll need. For sequential reads, it's helpful. For random I/O (databases, email queues, session storage), it wastes IOPS fetching data you won't use.
Check your current setting:
sudo blockdev --getra /dev/nvme0n1
The value is in 512-byte sectors. Default is often 256 (128 KiB). For random workloads, drop it:
sudo blockdev --setra 32 /dev/nvme0n1
That's 16 KiB of read-ahead. Make it permanent:
echo 'ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/read_ahead_kb}="16"' | sudo tee -a /etc/udev/rules.d/60-ioschedulers.rules
For file servers or media streaming, a higher value (512 or 1024) may perform better. Test with your actual workload.
Mistake 8: Running Web Servers Without TCP Fast Open
This one isn't NVMe-specific, but it compounds the problem. If you're serving dynamic content, every connection handshake adds latency. TCP Fast Open (TFO) embeds data in the SYN packet, shaving a round trip off each connection.
Enable it:
echo 'net.ipv4.tcp_fastopen=3' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Then configure your web server. For Nginx:
listen 443 ssl http2 fastopen=256;
For Apache, TFO support varies by MPM and version. Check your documentation.
TFO won't help bulk transfers, but for web apps with lots of short connections, it's a noticeable improvement.
Mistake 9: Forgetting to Disable Transparent Huge Pages for Databases
Transparent Huge Pages (THP) can improve performance for some workloads by reducing TLB misses. For databases with sparse memory access patterns, THP causes stalls when the kernel tries to defragment memory.
MySQL, MariaDB, PostgreSQL, MongoDB, and Redis all recommend disabling THP.
Check if it's enabled:
cat /sys/kernel/mm/transparent_hugepage/enabled
If you see [always] or [madvise], disable it:
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
Make it permanent by adding to /etc/rc.local or creating a systemd service that runs at boot.
Without this, you'll see periodic latency spikes when the kernel tries to compact memory. They're short — 50-200 ms — but they add up.
What to Check First
When a client complains their NVMe VPS is slow, I check the I/O scheduler, swappiness, and database flush settings. Those three account for most of the speed problems I see.
Run iostat -x 1 while the server is under load. If %util stays near 100% but await (average wait time) is low, you've hit IOPS limits — probably because swappiness or bad database settings are creating unnecessary writes. If await is high but %util is low, the I/O scheduler or queue depth is the bottleneck.
Fix the configuration, then measure. Don't assume faster hardware means you can skip tuning. NVMe gives you headroom, but only if you configure the software stack to use it.
