/go/speedtest: speedtest from the Command Line

/go/speedtest measures how long this server takes to insert 1,000 rows into MariaDB, one row at a time. Use it to compare servers, or to check the effect of a change to the disk or to the MariaDB settings (my). It creates a database named SpeedTest with one table, runs the 1,000 inserts, prints how many seconds that took, and drops the database. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/speedtest | tail -n 1

Examples

# Show only the result
/go/speedtest | tail -n 1

# Check that no database is already called SpeedTest
sudo mariadb -e "SHOW DATABASES LIKE 'SpeedTest';"

# Remove the temporary file the test leaves behind
rm -f /tmp/SpeedTest.test

# Review recent calls
tail /var/log/go/speedtest.log

Output

The command prints each number from 1 to 1000 as it goes, then the result:

1
2
3
...
1000
Time taken: 12 seconds

The time above is only an illustration.

The time is in whole seconds. Lower is faster. To turn it into a rate, divide 1,000 by the number of seconds, which gives the inserts per second.

Each insert is sent as a separate command, so the time also includes starting sudo and the mariadb client for every row. It shows the speed of the whole path, not only the database. Use it to compare runs on the same server, or between servers, and not as a pure database benchmark.

See the full reference at /go/speedtest and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *