Commit Graph

95 Commits

Author SHA1 Message Date
4bbccaac3c Add /usr/local/lib/lua/5.1 to default LUA_CPATH.
It is the default cpath used by LuaRocks.
2017-10-25 14:51:59 +03:00
1d37b3a8b3 Add /usr/local/share/lua/5.1 to default LUA_PATH.
The path is the default LuaRocks global install root, so it is a
frequent request to have it in the default LUA_PATH in sysbench.
2017-10-25 14:35:53 +03:00
f5fa7800cb A better version of the fix for #172. 2017-09-17 23:32:38 +03:00
cd13882cb6 Fix #172: sysbench 1.0.9 doesn't build with mariadb 10.2.8
Add a configure check for <server/mysql_version.h> which appears to be
the most portable way to fix MariaDB builds (see MDEV-13773).
2017-09-17 22:23:30 +03:00
a880fc4bcc Make sysbench.opt available to init()/done() by exporting it to global Lua state. 2017-09-15 20:43:28 +03:00
cd2b738022 Avoid PK conflicts in oltp_insert.lua by creating empty tables on 'prepare'. 2017-09-12 10:08:59 +03:00
305be15ebc Fix #168: oltp_delete.lua uses DELETE + INSERT statements
Remove INSERT statements from oltp_delete.lua.
2017-08-23 16:14:14 +03:00
9ca119c9c7 Add workaround for MySQL #87337 to build against 8.0.2. 2017-08-21 19:24:13 +03:00
21c747a6e4 Fix #161: build failure on debian kfreebsd-i386: "cannot detect the
dynamic library suffix"

Do not be too strict about platforms when choosing the shared library
suffix. Assume ."dylib" for MacOS and ".so" for everything else, since
we there is no Windows support at the moment.
2017-07-19 09:53:44 +02:00
0c12758222 Fix building against MariaDB 10.2 (thanks to Xavier Bachelot). 2017-07-13 15:29:02 +03:00
722b24b389 Print queue length and concurrency in the --rate mode.
This has been lost in refactoring beteen 0.5 and 1.0.
2017-07-04 11:28:07 +03:00
01eed4db66 Remove busy-wait in --rate mode to avoid CPU hogging.
In the bounded rate (--rate) mode, if the queue is empty, sleep for a
certain amount of time depending on the requested rate and the number of
worker threads instead of spinning on the queue.

Clean up some code duplication by removing sb_next_event().
2017-07-04 11:27:16 +03:00
66a410b192 Fix db_connect() in legacy API to initialize db_driver properly.
Fixes #146.
2017-06-07 22:09:55 +03:00
b57453df60 Report events per second in the CPU benchmark. Ref. #140. 2017-06-07 21:49:46 +03:00
6356e2b45e Fix #139: Json format has trailing comma
Remove a superfluous comma from the JSON reporter.
2017-06-04 20:03:17 +03:00
78024349bd sb_fileio.c: suggest to run prepare step
A recurring reason for errors is forgetting to run the prepare
step before running the file io test.

Write a warning line suggesting to run prepare.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-05-31 20:59:47 +03:00
fd34a95595 fix typo in --rand-pareto-h description 2017-05-27 13:42:03 +03:00
538521184a Compatibility fix for MySQL 8.0 client libraries.
The type of MYSQL_BIND::is_null has been changed from my_bool* to bool*
in MySQL 8.0. Since the size bool is not defined by the standard, we
either need to change the DB and Lua APIs to ensure is_null points to a
large enough buffer for MySQL API to store a bool, or do conversions
between sysbench and MySQL data structures. For now, just assert that
sizeof(bool) == 1, which is likely the case on all supported platforms.
2017-05-15 14:17:21 +03:00
3809f905e2 Fix a bug resulting in incorrect latencies reported from the --rate mode. 2017-05-01 21:44:49 -07:00
e472fb8aff Use sb_rand_uniform() instead of rand() in sb_mutex.c. 2017-04-28 17:16:06 -07:00
d15d273226 Fix #130: Mutex Benchmark Documentation
Fix --mutex-loops description to say it's the number of empty loops
outside the lock. Also, make the loops really empty by using a compiler
barrier instead of incrementing a local variable.
2017-04-28 17:08:54 -07:00
75b530c7fc Fix builds with MariaDB client libraries. 2017-04-12 19:34:30 +03:00
6ad3f09a07 Fix builds with MySQL 8.0.1 client libraries.
my_bool has been replaced with bool in MySQL 8.0.1.
2017-04-12 00:24:34 +03:00
3348e8dfa3 Remove unused gresults variable from drv_mysql.c. 2017-04-12 00:21:46 +03:00
480c34c33b Report errors thrown by the script properly with the 'sysbench modulename' syntax. 2017-04-02 10:42:01 +03:00
fb7e62db24 Allow benchmarks to be specified as a module name, i.e. a require() argument. 2017-03-31 13:52:55 +03:00
1fc8326c0d Prevent compiler from optimizing memory loads/stores in the memory benchmark. 2017-03-29 23:33:58 +03:00
a0658f09ce Memory benchmark optimizations.
Optimize the memory benchmark:
- get rid of the global mutex to calculate statistics
- remove if() and switch() branches on critical code paths
- align memory blocks to OS page size
- use native machine word size instead of 'int'
2017-03-29 21:02:07 +03:00
7fcbf2e025 Fix system ConcurrencyKit builds on ARMv6.
The problem reported for i686 in #118 also affects ARMv6. Fixed by
allowing workarounds in sb_ck_pr.h to work on architectures other than
i686.
2017-03-29 14:14:19 +03:00
154335edf6 Rename sb_option_copy() to sb_opt_copy() for consistency with other functions. 2017-03-17 11:57:39 +03:00
03c7eb5c29 Fix #123: Table already exists error on prepare
When the deprecated --num-threads option was used in OLTP prepare, the
sysbench.opt.threads variable exported to Lua scripts contained the
default value of 1, even though the actual number of threads created by
sysbench was higher. Which led to unexpected fireworks.

Now the deprecated options override the correspond sysbench.opt.*
variables when used.
2017-03-17 11:53:04 +03:00
d2bc5d50f8 Fix warning in 32-bit builds. 2017-03-13 14:38:25 +03:00
05f2a8e87b Fix #118: Build fails on i686 when using system ck
Provide compatibility wrappers for system (i.e. distribution-provided)
ConcurrencyKit on i386. Unlike bundled ConcurrencyKit, older versions
that may be provided by distributions do not support CK_USE_CC_BUILTINS,
which makes implementing 64-bit atomics impossible on x86 (32-bit).

Detect if 64-bit atomics are not provided at compile stage and if so,
resort to GCC builtin implementations.
2017-03-13 14:38:19 +03:00
89ab44d50e Fix #119 (oltp_insert.lua + --auto-inc=0 fails)
Fix oltp_insert.lua when run with --auto-inc disabled. Add regression tests.
2017-03-12 10:45:03 +03:00
6c7c13913d Fix -Wformat warnings in sb_fileio.c. 2017-03-10 11:43:25 +03:00
9bd33c7e41 Fix grammar in help text for --skip-trx. 2017-02-28 12:30:10 +03:00
b4f3d22c38 Build on Illumos 2017-02-26 12:02:33 +03:00
1d40ad0e1c Optimize random string generation in OLTP_RW.
Avoid Lua string management in OLTP_RW by introducing a new sql_param
method: set_rand_str(). Which calls sb_rand_str() in C code with a given
template string and a pre-allocated result buffer. In oltp_common.lua,
use set_rand_str() instead of allocating a new Lua string each time we
need a random string parameter for a prepared statement.
2017-02-25 19:57:55 +03:00
ba8b1d0781 Get rid of timers_mutex, improve --report-checkpoints scalability. 2017-02-14 20:53:08 +03:00
57b6f9d2b6 Correct a diagnostic message on index creation. 2017-02-08 22:46:28 +03:00
9c87d39700 Grammar fixes in a comment. 2017-02-08 21:45:51 +03:00
08e5b4fa9e Add a new line to an error message. 2017-02-02 23:32:46 +03:00
8359466dc7 Properly set the allocated array to 0 in sb_alloc_per_thread_array(). 2017-02-02 17:03:26 +03:00
d156b9b21f Exclude queries executed by background threads from statistic reports. 2017-02-02 15:25:54 +03:00
40c14789aa Export mysql_drv_reconnect() to Lua SQL API. 2017-02-02 10:59:51 +03:00
9fdec9dccf Rename sysbench.option_defs to sysbench.cmdline.options. 2017-02-01 19:31:53 +03:00
fdebeaffc3 Throw a more descriptive error when multiple DB drivers are available. 2017-02-01 19:03:13 +03:00
4a755b1c5d Make the default intermediate reports format a little more terse. 2017-02-01 18:57:37 +03:00
7f56e219f7 Rename --num-threads to --threads.
Accept the old name with a warning for compatibility.
2017-02-01 17:42:39 +03:00
788fcbb30b Rename --max-requests to --events, --max-time to --time.
Print warnings if old names are used, but accept them for compatibility.
2017-02-01 17:20:22 +03:00