• Hello and welcome! Register to enjoy full access and benefits:

    • Advertise in the Marketplace section for free.
    • Get more visibility with a signature link.
    • Company/website listings.
    • Ask & answer queries.
    • Much more...

    Register here or log in if you're already a member.

  • 🎉 WHV has crossed 56000 (56k) monthly views (unique) and 285135 clicks per month, as per Google Analytics! Thank you for your support! 🎉

How to Set Up a VPS for High IOPS Storage in Database-Heavy Apps

johny899

New Member
Content Writer
Messages
832
Reaction score
3
Points
23
Balance
$1,016.2USD
I’ll bet that you run applications that are constantly hitting the database. Now you want to increase the speed of your VPS because the storage space feels there’s too much latency. I’ve been there before, and one of the worse feelings is dealing with slowness in your database. So let’s talk about how to get your VPS up to high IOPS (i.e., real fast read/write) without making it too difficult. Sound fair?

The Importance of High IOPS​

Ever opened your app and seen it freeze for a second and wondered why? Many times it's the storage that’s creating the issue. All this means is that the disk has to work too hard to process the read/write.

High IOPS will help when you:

• Are running MySQL, PostgreSQL, MongoDB, etc.
• Are processing many read/write requests
• Have applications that write log file constantly
• Are doing a lot of heavy analytics

When the disk performs faster, the database performs faster - It's that simple.

Select the Correct VPS Storage​

VPS storage types differ among the service providers. Do you want lots of IOPS (Input/Output Operations per Seconds)? Choose the right storage.

NVMe SSD
  • Extremely fast
  • Best for databases
  • Provides the highest IOPS
When I host something important, I always choose NVMe SSD. Why would you use slow storage when your application requires speed?

SATA SSD
  • Good, but slower than NVMe
  • Okay for smaller applications
HDD
  • Very slow
  • Avoid for heavy database applications
Have you ever wondered why some cheap VPSs feel slow despite having a good CPU? Most of the time, it is the HDDs.

Choosing a Good Filesystem​

Your choice of system file system is very important, too.

ext4
  • Very reliable
  • Good performance
XFS
  • Good for workloads that write a lot of data
  • Well suited for large database
I find my self usually using ext4, because it just works and I never have any issue with it.

Tune Your Database Settings​

Even if you have fast storage, it won't matter if your database is not tuned. You might want to try some of the following settings:

For MySQL or MariaDB:
  • Increase innodb_buffer_pool_size
  • Use row format = dynamic
  • Enable innodb_flush_log_at_trx_commit = 2
For PostgreSQL:
  • Increase shared_buffers
  • Increase effective_cache_size
  • Tune your checkpoint_timeout
You'd be amazed at how little changes can make your server feel like new. Crazy, isn't it?

Use Caching to Reduce Disk Stress​

Why go to the disk over and over when you can use RAM instead?

Use:
  • Redis
  • Memcached
They will both lower disk usage and increase performance. I use Redis in nearly every project because it keeps everything smooth.

Check IOPS Regularly​

How do you know your server is fast? You check it.

Use:
  • iostat
  • iotop
  • Grafana dashboards
When you are watching the IOPS you will catch problems early.

Conclusion​

Setting up your VPS for IOPS is not that hard and you will need:
  • Fast NVMe storage
  • A good filesystem
  • Basic database tuning
  • Caching
  • Regular monitoring
Once you set these up, your database heavy apps will be running smoother and faster. Give it a try—you'll notice it immediately.
 
Top