Skip to content

Instantly share code, notes, and snippets.

@lilinghai
Created April 22, 2020 08:41
Show Gist options
  • Save lilinghai/73d81545361443b9a506aba7e355d9bd to your computer and use it in GitHub Desktop.
Save lilinghai/73d81545361443b9a506aba7e355d9bd to your computer and use it in GitHub Desktop.
Tikv #7584 bench
分别在 release-4.0(未 cherry-pick)和 release-3.0 (cherry-pick)测试
测试命令:
为了防止 pessimistic lock retry limit reached 错误 ,设置 [pessimistic-txn] max-retry-count =10000
sysbench waiter_manager.lua --table-size=10000 prepare & run
结果对比:
release-4.0:
Threads TPS latency 95th
100 59.92 5607.61
500 20.32 32745.49
1000 13.70 100000.00
release-3.0
Threads TPS latency 95th
100 242.71 1235.62
500 144.69 6960.17
1000 83.83 15371.13
#!/user/bin/env sysbench
require("oltp_common")
sysbench.cmdline.commands.prepare = {
cmd_prepare, sysbench.cmdline.PARALLEL_COMMAND
}
-- Called by sysbench one time to initialize this script
function thread_init()
-- Create globals to be used elsewhere in the script
-- drv - initialize the sysbench mysql driver
drv = sysbench.sql.driver()
-- con - represents the connection to MySQL
con = drv:connect()
end
-- Called by sysbench when script is done executing
function thread_done()
-- Disconnect/close connection to MySQL
con:disconnect()
end
function prepare_statements()
end
function create_table(drv, con, table_num)
local query
print("Creating table wmtest")
con:query("CREATE TABLE wmtest(k INT PRIMARY KEY, v INT)")
print(string.format("Inserting %d records into 'wmtest'", sysbench.opt.table_size))
con:bulk_insert_init("INSERT INTO wmtest VALUES")
for i = 1, sysbench.opt.table_size do
con:bulk_insert_next(string.format("(%d, 0)", i))
end
con:bulk_insert_done()
end
-- Called by sysbench for each execution
function event()
con:query("BEGIN PESSIMISTIC")
-- Run our custom statements
res=con:query(string.format("UPDATE wmtest SET v = v + 1 WHERE k IN (%d, 1)", sysbench.rand.uniform(2, sysbench.opt.table_size)))
con:query("COMMIT")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment