iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Use mysqlslap to measure how a MySQL server responds to a defined query while one or more simulated clients run it. A useful test fixes the schema, data, query text, server version, and connection settings; chooses explicit values for parallel clients and repetitions; runs first on a non-production system; and records the command and output. mysqlslap reports timings for its setup, load-test, and cleanup stages, so the result describes that complete scenario rather than a universal latency for one query.
The practical workflow is: prepare representative test data, optionally provide setup SQL, run a low-load baseline, increase concurrency or iterations deliberately, capture the output, and change only one factor between comparable runs.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →What mysqlslap measures
MySQL describes mysqlslap as a diagnostic program that emulates client load for a MySQL server and reports the timing of each stage. It behaves as though multiple clients are accessing the server. Every run has three stages:
| Stage | What happens | Connections | How to use the timing |
|---|---|---|---|
| Setup (create) | mysqlslap executes the SQL supplied through options such as --create, or prepares automatically generated test objects. |
One connection | Include this timing when you want to know the cost of preparing the test, but do not confuse it with query-service time. |
| Load test | The selected query runs under the requested client count and repetition settings. | One or many connections | This is the part to compare when studying behavior under concurrent query load. |
| Cleanup | mysqlslap removes or closes test resources as configured. | One connection | Cleanup can matter operationally, but it is not a measure of the query itself. |
Because the program reports stages, a command that creates a table, runs a query, and drops the table does not produce a pure single-expression stopwatch reading. Keep that distinction in the title and notes for every result.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Choose a safe, representative test target
Use development or staging, not production
Load emulation can open many client connections and repeat statements aggressively. MySQL warns that benchmark programs or packages can bring a system to its knees and recommends using them only on development systems. Run mysqlslap against a development or staging server with resource limits and monitoring. If production-like data is required, use a sanitized copy and confirm that writes, table creation, and cleanup cannot affect live users.
Make the test resemble the question you are asking
A query benchmark is only useful when its inputs represent the workload you intend to compare. Select a schema and data volume that exercise the relevant indexes, joins, filters, and result sizes. A tiny sample can hide a plan change that appears with a realistic table; a synthetic table can exaggerate or miss contention found in the application. Record the schema name, row counts or data-generation method, indexes, server version, and connection settings beside the result.
Freeze variables for a baseline
Keep the query text, setup SQL, schema, data, server version, and client connection settings fixed for the first comparison. Change one factor at a time afterward: for example, add one index, rewrite one predicate, alter the concurrency value, or change one server setting. Running the same command repeatedly gives you a sense of run-to-run variation before you attribute a difference to the change.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Understand the controls that define a run
The following options determine what mysqlslap sends and how much parallel work it creates.
| Option | Purpose | Important qualification |
|---|---|---|
--create |
Accepts a SQL string or a file containing setup statements. | Input files contain one statement per line by default; use an explicit delimiter when statements span lines or share a line. |
--query |
Accepts the query text or a file containing query statements. | Keep the exact text unchanged between baseline and comparison runs. |
--create-schema=name |
Selects the schema used by the test. | Point it at an isolated schema whose contents are known and reproducible. |
--concurrency=N |
Sets the number of parallel client connections during the load phase. | A higher value tests more simultaneous clients; it is not automatically a faster or better setting. |
--iterations=N |
Repeats the test the requested number of times. | Use the same value when comparing two configurations unless repetition count is the variable being studied. |
--number-of-queries=N |
Limits each client to approximately this many queries. | How statements are counted depends on the delimiter selected for the input. |
--delimiter=value |
Changes the statement separator used when mysqlslap reads SQL files or multi-statement strings. | For semicolon-separated statements, set --delimiter=";". |
--auto-generate-sql |
Builds an automatic test instead of requiring your own setup and query text. | With this mode, the created schema is dropped at the end unless --no-drop is supplied. |
--only-print |
Prints what mysqlslap would do without connecting. | Use it to inspect generated SQL and option handling before a live run. |
--csv[=file] |
Writes comma-separated output to a file, or to standard output when no file is supplied. | Keep the file with the command and environment notes so the result remains auditable. |
--pre-query |
Runs a statement before the test. | The statement is excluded from timing. |
--post-query |
Runs a statement after the test. | The statement is also excluded from timing. |
Run a first baseline step by step
- Define the question. Decide whether you are comparing two SQL formulations, checking an index change, or measuring behavior as concurrent clients increase. Write that question in the benchmark notes before choosing numbers.
- Prepare an isolated schema. Load representative tables and data on development or staging. Verify that the account used by the test can perform the setup and query work without touching unrelated schemas.
- Choose setup and query input. Put setup SQL in
--createwhen mysqlslap must build a small test object. Use--queryfor the statement under test, or point both options to files when the SQL is too large for a command line. - Check parsing without connecting. Add
--only-printand inspect the rendered command, generated SQL, and delimiter behavior. This catches a missing separator or an unintended statement before it creates load. - Start with modest load. Use a small
--concurrencyand--iterationsvalue to verify permissions, object names, and result correctness. A successful smoke test is safer than beginning with dozens of clients. - Capture the baseline. Run the command without the print-only switch, save the terminal output or use
--csv, and record the exact command, host environment, schema, data version, and date. - Repeat before changing anything. Several identical runs reveal whether timings are stable enough for the comparison. If they vary widely, investigate the test environment rather than declaring a small difference meaningful.
- Change one factor. Apply one index, query, client-count, or server-setting change, then rerun with every other input held constant.
Official command patterns
Supply a table and query, then apply concurrent clients
mysqlslap --delimiter=";"
--create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)"
--query="SELECT * FROM a"
--concurrency=50 --iterations=200
This pattern creates a table and row, executes the supplied query with 50 parallel clients, and repeats the test 200 times. The figures are example settings, not published performance results. Use smaller values while validating a new test, then choose load levels that answer your own question.
Generate a test automatically
mysqlslap --create-schema=mydb
--concurrency=5 --iterations=20
--number-int-cols=2 --number-char-cols=3
--auto-generate-sql
The automatic mode creates its test schema and objects. mysqlslap drops the created schema at the end unless you add --no-drop. Treat generated data as a convenient smoke test, not a substitute for application-shaped rows when query plans depend on realistic distributions.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Read setup and query files
mysqlslap --create-schema=mydb
--concurrency=5 --iterations=5
--query=query.sql --create=create.sql
--delimiter=";"
This file-based pattern uses semicolons as delimiters. Keep create.sql and query.sql under version control with the benchmark notes, and verify that the files contain only statements mysqlslap can parse.
Handle SQL files and delimiters deliberately
By default, mysqlslap treats one line as one statement when reading a file. That rule matters when a statement is formatted across several lines or when multiple statements share one line. Set --delimiter=";" when semicolons separate statements, as in the examples above. The delimiter also affects how --number-of-queries counts work, so a changed delimiter can alter the amount of load even when the visible SQL text looks similar.
mysqlslap does not understand comments in SQL input files. Remove comments or place explanatory notes outside the file before running the test. Keep setup and query files focused on executable statements, and validate them with --only-print before connecting.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Design concurrency, iterations, and query counts
Concurrency answers a pressure question
--concurrency=N asks how the server behaves when N clients issue the test workload in parallel. Test a sequence that reflects the decision you need to make, such as a low value for a baseline followed by progressively higher values. Increasing concurrency can expose lock waits, connection limits, CPU saturation, or I/O pressure, but mysqlslap alone does not identify which resource caused a change.
Recommended Free Tools
Iterations improve repeatability
--iterations=N repeats the test. Keep concurrency fixed while changing iterations if you are studying repeatability; keep iterations fixed while changing concurrency if you are studying load. Document whether an iteration includes setup and cleanup in the command you ran, because the reported stages are part of the run definition.
Number-of-queries controls per-client work
--number-of-queries=N limits each client to approximately N queries. “Approximately” matters because statement counting follows the selected delimiter. If you need an exact, reviewable workload, use a clearly delimited query file and record the delimiter with the command.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Use hooks without contaminating timings
Use --pre-query for preparation that must happen immediately before the measured work, such as resetting a test state. Use --post-query for cleanup that should happen immediately afterward. mysqlslap excludes both statements from timing. That exclusion is useful for isolating the load phase, but it also means the reported result will not include the cost of those hooks. Describe them in your notes so another person knows the state in which the query ran.
Capture and inspect results
Validate a command before a live run
Run with --only-print first when you are using generated SQL, multiple statements, or files. Inspect the selected schema, query text, delimiter, client count, iterations, and any pre- or post-query statements. This mode does not connect, so it is safe for checking syntax assembled by mysqlslap; it does not prove that the SQL will succeed on the server.
Save machine-readable output
Use --csv=file to write comma-separated output to a file, or --csv to send it to standard output. Preserve the CSV alongside the exact command and environment metadata. A CSV without its concurrency, iteration count, query version, and data description cannot support a reliable later comparison.
Read the stages, not just one number
Inspect the reported setup, load, and cleanup timings. For a query-under-concurrency question, focus on the load-stage comparison while still recording the other stages. If setup time changes because the schema or data changed, that is a separate finding from a change in query service time. Do not present a mysqlslap result as a guaranteed latency for every application request: it is timing for the clients, SQL, data, and server conditions defined by that command.
Common failure modes and corrections
- The file is parsed as one long statement. Set an explicit delimiter, normally
--delimiter=";", and ensure separators appear where each statement ends. - A multiline statement fails. The default one-statement-per-line behavior may not match the file formatting. Use a delimiter that matches the file and test it with
--only-print. - Comments cause an input error. mysqlslap does not understand comments in SQL files. Remove them and keep documentation in a separate benchmark note.
- The automatic test removes the schema. Add
--no-dropwhen you need the generated schema to remain after the run, and use an isolated schema so retained objects cannot interfere with other work. - A run overloads the server. Stop increasing client count, return to development or staging, and resume with smaller concurrency and iteration values. Benchmark packages are capable of disrupting a system.
- Two runs are not comparable. Check that query text, schema, data, indexes, server version, connection settings, delimiter, concurrency, and iterations match. Change one intentional variable and rerun.
- The result answers the wrong question. If you are measuring a single expression or function rather than concurrent client behavior, use the microbenchmark method described below instead of interpreting mysqlslap as a universal stopwatch.
When another benchmark method is a better fit
| Need | Appropriate method | What it tells you | What it does not replace |
|---|---|---|---|
| Measure one SQL expression or function repeatedly | BENCHMARK(loop_count, expr) through the mysql client |
MySQL reports elapsed execution time while the function returns zero. | It does not emulate many clients or represent an application workload. |
| Measure one query under controlled client concurrency | mysqlslap | Stage timings for setup, load, and cleanup with explicit client and repetition controls. | It does not by itself diagnose every server bottleneck or model the entire application. |
| Simulate a broader application or high-load benchmark | SysBench or DBT2 | Broader benchmark packages can model workloads beyond a single mysqlslap query. | They require their own workload design and operational safeguards. |
Choose the narrowest tool that matches the question. A function microtest can isolate expression cost; mysqlslap can show how a query behaves when clients issue it simultaneously; a broader suite is more suitable when application-level interactions are the subject.
Build a reproducible benchmark record
For every run, keep a short record containing:
- the complete mysqlslap command, including delimiter, schema, concurrency, iterations, query count, and hooks;
- the exact contents or version identifiers for setup and query files;
- server version, host role (development or staging), connection settings, and test date;
- table definitions, indexes, data-generation method, and approximate data volume;
- captured terminal output or CSV output;
- the single factor changed from the previous baseline;
- any operational event observed during the run, such as an aborted test or resource saturation.
This record lets another engineer recreate the same client-load scenario and tells readers exactly what the reported timings include. It also prevents an example setting such as 50 clients and 200 iterations from being mistaken for a performance promise.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
A practical decision sequence
- Start with
BENCHMARK(loop_count, expr)when the question is only the cost of one expression or function. - Use mysqlslap when the question is how a specific query behaves with controlled concurrent clients.
- Use a broader package such as SysBench or DBT2 when the question spans multiple operations or the whole application workload.
- Whichever method you choose, run on development or staging, keep inputs reproducible, capture output, and increase load gradually.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

