Troubleshooting

Test SSD and RAM speed and on VPS

by , , revisited on


We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish and lots of useful modules for them, this is your one stop repository to get all performance related software.
You have to maintain an active subscription in order to be able to use the repository!

What I really like about VPS providers these days is ability to spin up an instance, and test if it’s good by measuring hardware performance. I would then discard it or proceed with it on permanent basis based on performance level. All major cloud providers (DigitalOcean, Linode, Vultr VPS) allow you to test them with their per-hour billing model. And this is great!

But how do you test performance of a VPS in a reliable way?

First, sign up for any of the hosting providers mentioned. Next, create a new VPS with the lowest RAM amount available.

All the testing is done via SSH. Once you are logged in as root user, you can test performance of disk, RAM and CPU.

Test SSD Disk performance

With modern PHP frameworks (WordPress can be considered as one), consisting of hundreds of small PHP files, it is extremely important to run the server off an SSD drive. Many hosting providers advertise SSD in their plans. But you may still find your site running slow. Common reason? Yes, they lied to you and they actually installed regular SATA drive. You can test SSD existence and speed by running simple test:

dd if=/dev/zero of=sb-io-test bs=1M count=1k conv=fdatasync; rm -rf sb-io-test

This will show you the speed of accessing the drive. If you find the number below 150 MB/s, be certain that it is not an SSD drive. If it is below 50 MB/s, it is a SATA drive that is having problems.

Upon running the test on a few VPS providers, I found that Linode is the fastest provider with real SSD performance: 700 MB/sec.

Test CPU performance

Install SysBench utility first using the following:

yum install libtool mysql-devel
wget http://sourceforge.net/projects/sysbench/files/latest/download
# or: wget http://downloads.mysql.com/source/sysbench-0.4.12.5.tar.gz
tar xvzf sysbench-0.4.12.tar.gz 
cd sysbench-0.4.12
libtoolize --force --copy 
./autogen.sh
./configure
make
make install

Run the actual test with:

sysbench —test=cpu —cpu-max-prime=20000 run

Test RAM performance

You can also use SysBench for testing RAM performance:

sysbench --test=memory --memory-total-size=1G run
  1. Luparu Nicu

    I have a vps that empty, only with the debian8 64 operating system consumes 0.8G of memory, is it normal?

    Reply
    • Danila Vershinin

      It depends on what services enabled at startup and what device drivers are in use.

      Reply
  2. Provas

    Hi Danila, very good post. My VPS server is constantly down because low memory status, ( 1GB available, but when executing ‘free’ command is always near to 0. or only few mb) . Do you know how to free memory with command line? is it possible with workbench? Thanks in advance

    Reply
    • Danila Vershinin

      Hi Private, you’d rather have to configure the server to not reach “out of memory” state. This is usually achieved through lowering PHP-FPM max_children setting, MySQL innodb buffer pool lowering, etc.

      Reply
  3. IT Blog

    Thank you for your great info, i have VPS from some company but i found that the speed is not high and is not low look at the result:
    dd if=/dev/zero of=/tmp/basezap.img bs=512 count=1000 oflag=dsync
    1000+0 records in
    1000+0 records out
    512000 bytes (512 kB) copied, 3.93107 s, 130 kB/s

    Time is 4s and speed is 130kB/s and they said to me this is SSD VPS….are this is true?

    Regards,

    Reply
    • Danila Vershinin

      Your test is “flawed”. You’re testing by writing to tmp, which is usually mounted to RAM. And only 512k of data wouldn’t be presentable. Use test as given in my post, and run in a directory where e.g. your site files are present.

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.