mysqlslap is a load-testing tool bundled with MySQL that measures query performance under simulated concurrent client load. This guide covers setting up a test environment with the MySQL employees sample database, running auto-generated SQL tests for hardware baselines, benchmarking custom queries via inline SQL or .sql files, sweeping concurrency levels to find saturation points, comparing InnoDB vs MyISAM performance, capturing production queries for safe replay against a test copy, and connecting to remote/managed MySQL instances with SSL. It also explains how to interpret output metrics (average, min, max latency), use EXPLAIN ANALYZE and SHOW ENGINE INNODB STATUS to diagnose bottlenecks, and compares mysqlslap to sysbench and other tools.
Table of contents
IntroductionPrerequisitesKey TakeawaysHow mysqlslap WorksStep 1 - Verify mysqlslap Is Available on Your SystemStep 2 - Install MySQL and Load a Sample DatabaseStep 3 - Run Your First Benchmark with Auto-Generated QueriesStep 4 - Test with Custom SQL QueriesStep 5 - Simulate Concurrent ConnectionsStep 6 - Benchmark Specific Storage EnginesStep 7 - Capture Live Queries and Run Realistic BenchmarksStep 8 - Test Against DigitalOcean Managed MySQLInterpreting mysqlslap Results and Taking Actionmysqlslap vs. Other MySQL Benchmarking ToolsTroubleshootingFAQConclusionSort: