You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During to work on #5645, I am faced with the necessity to create a performance test for iproto.
Here is a test example:
-- Test starts server with different count of iproto threads, calculates-- performance and latency of simple iproto calls and saved result in the-- table format in the file with a name perf.txt.env=require('test_run')
clock=require('clock')
net_box=require('net.box')
fiber=require('fiber')
test_run=env.new()
test_run:cmd("create server perf with script='perf/iproto.lua'")
test_run:cmd("setopt delimiter ';'")
functionlatency(bench_count, server_addr, result, threads_count)
localtime_before=clock.monotonic64()
for_=1, bench_countdolocalconn=net_box.new(server_addr)
pcall(conn.call, conn, 'ping')
endresult[threads_count].latency=tonumber(clock.monotonic64() -time_before) / (1.0e6*bench_count)
end;
functionbenchmark(bench_count, server_addr, result, threads_count)
localfibers_count=100localfibers= {}
localtime_before=clock.monotonic64()
fori=1, fibers_countdofibers[i] =fiber.new(function()
localconn=net_box.new(server_addr)
for_=1, bench_countdopcall(conn.call, conn, 'ping')
endend)
fibers[i]:set_joinable(true)
endfor_, finipairs(fibers) dof:join()
endresult[threads_count].benchmark=
(1.0e9*fibers_count*bench_count) /
(1.0e6*tonumber(clock.monotonic64() -time_before))
end;
functionbenchmark_save_result(result)
localone_thread_perf=result[1].benchmarklocalfile=io.open("perf.txt", "w+")
iffile==nilthenreturnendio.output(file)
io.write(" ________________________________________________________________\n")
io.write("| iproto threads count | latency, ms | performance, Mrps |\n")
io.write("|----------------------------------------------------------------|\n")
forthreads_count, valinpairs(result) doio.write(string.format("| %2d ", threads_count))
io.write(string.format("| %0.3f ", val.latency))
io.write(string.format("| %6.4f |\n", val.benchmark))
endio.write("|----------------------------------------------------------------|\n")
io.close(file)
end;
test_run:cmd("setopt delimiter ''");
threads_count=1threads_count_max=16bench_count=1000result= {}
test_run:cmd("setopt delimiter ';'")
whilethreads_count<=threads_count_maxdotest_run:cmd(string.format('start server perf with args=\"%d\"', threads_count))
server_addr=test_run:cmd("eval perf 'return box.cfg.listen'")[1]
result[threads_count] = {}
latency(bench_count, server_addr, result, threads_count)
benchmark(bench_count, server_addr, result, threads_count)
threads_count=threads_count*2test_run:cmd("stop server perf")
end;
test_run:cmd("setopt delimiter ''");
benchmark_save_result(result)
test_run:cmd("cleanup server perf")
test_run:cmd("delete server perf")
but there are several problems with this test.
In case when iproto thread is not a bottleneck, one or more threads have the same performance. We need to create a test, which demonstrates a case when several iproto threads are better than one.
Current test saves the result in a file, we need a test, which runs on CI every time and checks performance.
The text was updated successfully, but these errors were encountered:
kyukhin
changed the title
Create useful iproto performance test and integrate it into current testing system
Create iproto performance test and integrate it into current testing system
Jul 14, 2021
During to work on #5645, I am faced with the necessity to create a performance test for iproto.
Here is a test example:
but there are several problems with this test.
The text was updated successfully, but these errors were encountered: