Search code examples
performancewebserver

Measure performance of a VPS intended for hosting a website


I just bought for a month an extremely cheap VPS with 16 GB RAM and 6 cores(from Contabo)

Now my question is, how can I get some benchmark results in order to compare it with other VPSes like Hostinger provides?

I did a Geekbench benchmark on it and the results can be seen here: https://browser.geekbench.com/v4/cpu/15852309

The problem with Geekbench is that I feel it's not really web oriented as the scores are influenced by the GPU as well.

What should I use in order to compare the VPSes between them? Would the plan be enough to host a Magento 2 website / possibly more?


Solution

  • For webserver performance the Network, Disk (random read) and CPU performance are the most important factors.

    I like to benchmark and compare each one separately.

    For Disk I/O performance, can use sysbench:

    apt install sysbench
    sysbench fileio --file-num=4 prepare
    sysbench fileio --file-num=4 --file-test-mode=rndrw run
    

    For CPU performance can use stress-ng:

    apt install stress-ng
    stress-ng -t 5 -c 2 --metrics-brief
    

    -c 2 uses 2 logical processors. Adjust if necessary.

    For network performance can use speedtest-cli:

    apt install speedtest-cli
    speedtest-cli
    

    Example output:

    # sysbench fileio --file-num=4 --file-test-mode=rndrw run
    <skip>
    
    Throughput:
        read, MiB/s:                  45.01
        written, MiB/s:               30.00
    
    # stress-ng -t 5 -c 2 --metrics-brief
    stress-ng: info:  [14993] dispatching hogs: 2 cpu
    stress-ng: info:  [14993] successful run completed in 5.00s
    stress-ng: info:  [14993] stressor       bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
    stress-ng: info:  [14993]                           (secs)    (secs)    (secs)   (real time) (usr+sys time)
    stress-ng: info:  [14993] cpu                3957      5.00      9.99      0.00       790.92       396.10
    
    # speedtest-cli
    Retrieving speedtest.net configuration...
    Testing from <skip> ...
    Retrieving speedtest.net server list...
    Selecting best server based on ping...
    Hosted by Uganda Hosting Limited (Helsinki) [0.20 km]: 1.807 ms
    Testing download speed................................................................................
    Download: 575.68 Mbit/s
    Testing upload speed................................................................................................
    Upload: 499.89 Mbit/s