Linux command(sysbench)

Simply put

  1. CPU test:
    sysbench --test=cpu --cpu-max-prime=20000 run
    This command will run a CPU stress test with a maximum prime number of 20000.

  2. Memory test:
    sysbench --test=memory --memory-block-size=1M --memory-total-size=10G run
    This command will run a memory benchmark with a block size of 1MB and a total size of 10GB.

  3. File I/O test:
    sysbench --test=fileio --file-total-size=10G prepare
    sysbench --test=fileio --file-total-size=10G --file-test-mode=rndrw run
    sysbench --test=fileio --file-total-size=10G cleanup
    These commands will prepare, run, and cleanup a file I/O benchmark with a total file size of 10GB and a random read/write test mode.

  4. MySQL OLTP test:
    sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=password prepare
    sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=password --max-time=60 --max-requests=1000000 --num-threads=8 run
    sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=password cleanup
    These commands will prepare, run, and cleanup a MySQL OLTP benchmark with a test database named “test”, using the root user with the password “password”, running for a maximum of 60 seconds with 8 threads and a maximum of 1 million requests.

Note that these are just a few examples of commonly used commands for Sysbench 0.4.12. The tool has many more options and parameters that can be used for testing various system components. You can refer to the official documentation for more information on how to use Sysbench.

GITHUB

https://github.com/akopytov/sysbench

你可能感兴趣的:(Linux,linux,mysql,数据库)