Skip to content
Back to Blog
Performance9 min read

9 NVMe VPS Hosting Performance Mistakes That Kill Speed

Even NVMe storage won't save you from these configuration errors. Learn the exact mistakes that throttle VPS performance and how to fix each one.

Written by Abdul AbrorTechnical Hosting Support Engineer
9 NVMe VPS Hosting Performance Mistakes That Kill Speed
On this page

Why fast drives don't guarantee fast servers

You paid for NVMe. The marketing promised sub-millisecond latency and read speeds that make SATA look prehistoric. But your application still feels sluggish, pages take three seconds to render, and database queries crawl.

The storage itself is rarely the bottleneck. I've debugged hundreds of "slow VPS" tickets where customers blamed the provider, only to find self-inflicted wounds in the OS layer, filesystem configuration, or application stack. NVMe gives you raw speed, but poor tuning kills it before it reaches your workload.

Here are the nine mistakes I see most often.

Mistake 1: Running the inbox kernel I/O scheduler

Most distributions ship with either mq-deadline or BFQ as the default I/O scheduler. These were designed for rotational disks. NVMe doesn't need reordering or seek-time optimization—every block is equally fast.

Check your current scheduler:

cat /sys/block/nvme0n1/queue/scheduler

If you see [mq-deadline] or [bfq], you're adding unnecessary CPU overhead and latency. Switch to none (which actually means the multi-queue block layer handles everything directly):

echo none > /sys/block/nvme0n1/queue/scheduler

Make it permanent by adding elevator=none to your kernel command line in /etc/default/grub and running update-grub.

On a busy web server I tuned last month, this single change dropped disk wait time by forty percent. No other configuration touched.

Mistake 2: Ignoring the readahead value

Linux prefetches data into cache based on the readahead setting. The default is often 128 KB, which made sense for spinning disks. NVMe can serve random small reads so fast that aggressive readahead just wastes RAM and I/O bandwidth.

For random-access workloads like databases, drop it:

blockdev --setra 8 /dev/nvme0n1

For sequential workloads like video streaming or large file transfers, you can safely increase it to 512 or 1024. Match the setting to your access pattern.

Persist changes via udev rule in /etc/udev/rules.d/60-readahead.rules:

ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/read_ahead_kb}="8"

Mistake 3: Using the wrong filesystem or mount options

Ext4 is fine, but many hosting customers never optimize the mount flags. Three stand out.

noatime: Every file read updates the access timestamp by default. That turns reads into writes. Add noatime to /etc/fstab:

/dev/nvme0n1p1 / ext4 defaults,noatime 0 1

discard vs fstrim: Continuous discard (discard mount option) tells the filesystem to TRIM blocks immediately on delete. This sounds good but adds latency to every unlink operation. Better to run fstrim once a week via cron:

0 3 * * 0 /sbin/fstrim -a

Barrier settings: Most modern NVMe drives have power-loss protection. If yours does, you can disable write barriers with nobarrier (ext4) or nobarrier (XFS). Check your drive spec first—data corruption is worse than slow writes.

For databases, XFS often edges out ext4 on NVMe because it handles parallel writes better and supports reflink COW.

Mistake 4: Running a swap file on NVMe

Swap on NVMe is tempting because it's "fast enough." It's still two orders of magnitude slower than RAM. Worse, aggressive swapping creates write amplification that wears the drive and injects latency spikes into everything else.

Check how much you're swapping:

vmstat 1

Look at the si and so columns. If you see sustained non-zero values, you're paging. Either add RAM or tune swappiness:

sysctl vm.swappiness=10

The default is 60. Dropping to 10 tells the kernel to avoid swap until RAM pressure is severe. Make it permanent in /etc/sysctl.conf.

If your workload truly needs more memory than you have, resize the VPS. Swap is for emergencies, not steady-state operation.

So what if I/O looks fine but queries are still slow?

Mistake 5: Misconfigured database buffer pools

MySQL and PostgreSQL cache data in RAM. If the buffer pool is too small, every query hits disk. If it's too large, the OS has no RAM left for filesystem cache, and non-database I/O suffers.

For MySQL (InnoDB), check:

mysql -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"

Rule of thumb: 60-70% of total RAM on a dedicated database server, 40-50% if you run other services. A 4 GB VPS should allocate roughly 2 GB.

Set it in /etc/mysql/my.cnf:

[mysqld]
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 2

The flush setting trades a tiny bit of durability (one second of transactions at most) for much lower write latency. Acceptable for most web apps.

PostgreSQL uses shared_buffers (start at 25% of RAM) and relies more heavily on the OS page cache. Also tune effective_cache_size to tell the planner how much RAM is available:

shared_buffers = 1GB
effective_cache_size = 3GB

Restart the service after changes.

Mistake 6: Logging everything to disk synchronously

Application logs, web server access logs, and syslog all write constantly. Default configurations often fsync every line, which means the write doesn't return until NVMe confirms the data is durable. That's dozens of IOPS burned on log entries nobody reads.

For Nginx, buffer access logs:

access_log /var/log/nginx/access.log combined buffer=32k flush=10s;

For PHP-FPM and app logs, write to a tmpfs mount:

mount -t tmpfs -o size=256M tmpfs /var/log/app

Rotate to disk later if you need retention. Critical errors should still go to persistent storage.

Systemd journal can also flood I/O. Limit it:

# /etc/systemd/journald.conf
SystemMaxUse=200M
RuntimeMaxUse=50M

Mistake 7: Running too many concurrent PHP-FPM or app workers

More workers don't automatically mean more throughput. Each PHP-FPM child allocates memory and competes for CPU and I/O. If you run 50 workers on a 2-core VPS, the scheduler spends more time context-switching than executing code.

Check current worker count:

ps aux | grep php-fpm | wc -l

A safe starting point: (CPU cores * 2) + spare. For a 2-core VPS, try 6-8 workers:

; /etc/php/8.2/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 8
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

Monitor with php-fpm status and adjust based on queue length and CPU idle time.

Mistake 8: Skipping opcache or caching plugins

PHP compiles scripts on every request by default. OPcache stores the compiled bytecode in RAM. Enabling it is trivial and often cuts CPU usage in half.

Verify it's enabled:

php -v | grep OPcache

If not, edit php.ini:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60

For WordPress, add Redis or Memcached for object caching. NVMe makes the filesystem fast, but RAM is still faster. A persistent cache plugin (Redis Object Cache, W3 Total Cache) removes thousands of filesystem stat calls per page load.

Mistake 9: No monitoring, so you never see the actual bottleneck

You can't optimize what you don't measure. Install atop or iotop to see which processes consume I/O bandwidth:

apt install atop
atop -d 5

Press d to sort by disk activity. You'll often find a rogue backup script, log rotator, or indexing job that runs during peak hours.

For continuous monitoring, deploy Netdata:

bash <(curl -Ss https://get.netdata.cloud/kickstart.sh)

It graphs IOPS, latency, queue depth, CPU wait time, and memory pressure in real time. The web UI runs on port 19999.

Check NVMe-specific metrics:

nvme smart-log /dev/nvme0n1

Watch the "Percentage Used" and "Available Spare" fields. If the drive is failing, no amount of tuning will help.

What to check first when NVMe feels slow

Start with I/O scheduler and mount options—they're one-line fixes with outsized impact. Confirm your application actually uses the fast disk (some stacks default to /tmp on a separate partition). Verify the buffer pool or cache layer is sized correctly for your RAM.

Run iostat -x 1 during a slow period. If %util is under 50% but latency is high, the bottleneck is probably CPU or RAM, not disk. If await is under 5 ms, NVMe is doing its job.

Most speed problems I've diagnosed come down to the OS or application layer fighting the hardware instead of using it. Fix the mistakes above, measure the impact, then move to the next bottleneck.

Common questions

Q: Will these changes help on SATA SSD or spinning disks?
Some will. Scheduler changes and noatime are universal wins. But readahead tuning and no-barrier mounts are NVMe-specific—rotational disks need different values.

Q: How do I know if my VPS actually uses NVMe?
Run lsblk -d -o name,rota. A 0 in the ROTA column means non-rotational (SSD or NVMe). Check /sys/block/*/device/model for the drive name.

Q: Can I break something by setting the scheduler to none?
No. It's the recommended setting for NVMe. Worst case, you see no improvement and switch back.

Q: My provider says they use NVMe RAID. Does that change anything?
Hardware RAID controllers sometimes hide the raw NVMe performance behind their own cache and scheduling. Check with your provider whether the RAID layer supports TRIM and what scheduler they recommend.

Q: Should I use fstrim or the discard mount option?
Batch fstrim via cron. The discard mount option adds latency to every delete and offers no real advantage on a VPS where you control the maintenance window.

Speed comes from alignment, not just hardware

NVMe delivers speed. Your job is to remove the layers that smother it. A misconfigured I/O scheduler adds milliseconds every request. Excess logging burns IOPS. A tiny buffer pool forces the database to disk on every query.

Fix the mistakes, measure the result, repeat. Your VPS will feel faster because it actually is.