Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
22c5217d
Commit
22c5217d
authored
Oct 16, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
80eaa05e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
40 deletions
+43
-40
go/neo/t/neotest
go/neo/t/neotest
+43
-40
No files found.
go/neo/t/neotest
View file @
22c5217d
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
set
-o
pipefail
set
-o
pipefail
# FIXME warn if/when thermal throttling activates
- XXX how?
# FIXME warn if/when thermal throttling activates
# ---- deploy NEO for tests/benchmarks at a node ----
# ---- deploy NEO for tests/benchmarks at a node ----
...
@@ -104,9 +104,9 @@ EOF
...
@@ -104,9 +104,9 @@ EOF
popd
popd
go get
-v
lab.nexedi.com/kirr/neo/go/...
go get
-v
lab.nexedi.com/kirr/neo/go/...
go get
-v
github.com/pkg/profile
# used by zhash.go
go get
-v
github.com/pkg/profile
# used by zhash.go
go get
-v
golang.org/x/perf/cmd/benchstat
# to summarize/diff benchmark results
go get
-v
golang.org/x/perf/cmd/benchstat
# to summarize/diff benchmark results
#go get -v github.com/aclements/perflock/cmd/perflock
#go get -v github.com/aclements/perflock/cmd/perflock
# handy to fix CPU frequency/etc
git clone
-o
kirr
-b
x/hist https://lab.nexedi.com/kirr/ioping.git
git clone
-o
kirr
-b
x/hist https://lab.nexedi.com/kirr/ioping.git
pushd
ioping
pushd
ioping
...
@@ -117,7 +117,7 @@ EOF
...
@@ -117,7 +117,7 @@ EOF
echo
"# deployed ok"
echo
"# deployed ok"
}
}
# jump to deploy early if we have to
# jump to deploy
command
early if we have to
case
"
$1
"
in
case
"
$1
"
in
deploy|deploy-local
)
deploy|deploy-local
)
cmd
=
"
$1
"
cmd
=
"
$1
"
...
@@ -147,8 +147,8 @@ $@
...
@@ -147,8 +147,8 @@ $@
# init_net - initialize networking
# init_net - initialize networking
init_net
()
{
init_net
()
{
#
local
our external address IPv4 or IPv6
# our external address IPv4 or IPv6
#
XXX better parse `ip addr`
#
FIXME better parse `ip addr` - getent relies on /etc/hosts which needs to be manually setup
myaddr
=
$(
getent hosts
`
hostname
`
|grep
-v
127.0 |awk
'{print $1}'
)
myaddr
=
$(
getent hosts
`
hostname
`
|grep
-v
127.0 |awk
'{print $1}'
)
test
-n
"
$myaddr
"
||
die
"init_net: cannot determine my network address"
test
-n
"
$myaddr
"
||
die
"init_net: cannot determine my network address"
...
@@ -157,8 +157,8 @@ init_net() {
...
@@ -157,8 +157,8 @@ init_net() {
Mbind
=[
$myaddr
]
:5552
# NEO master
Mbind
=[
$myaddr
]
:5552
# NEO master
Zbind
=[
$myaddr
]
:5553
# ZEO
Zbind
=[
$myaddr
]
:5553
# ZEO
# NEO storage. bind not strictly needed but
we make sure no 2 storages a
re
# NEO storage. bind not strictly needed but
this way we also make su
re
#
started at the same time
#
no 2 storages are started at the same time.
Sbind
=[
$myaddr
]
:5554
Sbind
=[
$myaddr
]
:5554
}
}
...
@@ -352,6 +352,10 @@ GENfs() {
...
@@ -352,6 +352,10 @@ GENfs() {
demo-zbigarray
--worksize
=
$work
gen
$fs1
/data.fs
demo-zbigarray
--worksize
=
$work
gen
$fs1
/data.fs
sync
sync
touch
$var
/generated.fs
touch
$var
/generated.fs
# remember correct hash to later check in benchmarks
# crc32:1552c530 ; oid=0..2127 nread=8534126 t=0.033s (15.7μs / object) x=zhash.py
./zhash.py
--zhashfunc
$fs1
/data.fs |awk
'{print $1}'
>
$var
/zhash.ok
}
}
# generate data in sqlite
# generate data in sqlite
...
@@ -660,6 +664,8 @@ system_info() {
...
@@ -660,6 +664,8 @@ system_info() {
# cpustat ... - run ... and print CPU C-states statistic
# cpustat ... - run ... and print CPU C-states statistic
cpustat
()
{
cpustat
()
{
# XXX +cpufreq transition statistics (CPU_FREQ_STAT) ?
syscpu
=
/sys/devices/system/cpu
syscpu
=
/sys/devices/system/cpu
cpuv
=(
`
ls
-vd
$syscpu
/cpu[0-9]
*
`
)
cpuv
=(
`
ls
-vd
$syscpu
/cpu[0-9]
*
`
)
# XXX we assume cpuidle states are the same for all cpus and get list of them from cpu0
# XXX we assume cpuidle states are the same for all cpus and get list of them from cpu0
...
@@ -724,6 +730,10 @@ nrun() {
...
@@ -724,6 +730,10 @@ nrun() {
}
}
# nrunpar ... - run $Npar ... instances in parallel and wait for completion
# nrunpar ... - run $Npar ... instances in parallel and wait for completion
nrunpar
()
{
$profile
_nrunpar
"
$@
"
}
_nrunpar
()
{
_nrunpar
()
{
local
jobv
local
jobv
for
i
in
`
seq
$Npar
`
;
do
for
i
in
`
seq
$Npar
`
;
do
...
@@ -733,10 +743,6 @@ _nrunpar() {
...
@@ -733,10 +743,6 @@ _nrunpar() {
wait
$jobv
wait
$jobv
}
}
nrunpar
()
{
$profile
_nrunpar
"
$@
"
}
# bench_cpu - microbenchmark CPU
# bench_cpu - microbenchmark CPU
bench_cpu
()
{
bench_cpu
()
{
nrun sh
-c
"python -m test.pystone |tail -1 |sed -e
\
nrun sh
-c
"python -m test.pystone |tail -1 |sed -e
\
...
@@ -775,42 +781,37 @@ Benchmark$1-avg 1 \\3 \\4/op\
...
@@ -775,42 +781,37 @@ Benchmark$1-avg 1 \\3 \\4/op\
ioping2bench
"
`
hostname
`
/disk/randread/pagecache/4K"
ioping2bench
"
`
hostname
`
/disk/randread/pagecache/4K"
}
}
#hashfunc=sha1
# hash function to compute via zhash in tests/benchmarks
#hashfunc=adler32
zhashfunc
=
crc32
# sha1, adler32, null, ...
hashfunc
=
crc32
#hashfunc=null
# bench <topic> <url> - run ZODB client benchmarks against URL
# zbench <url> <topic> <zhashok> - run ZODB client benchmarks against URL
bench
()
{
zbench
()
{
# XXX show C states usage diff after each benchmark XXX + same for P-states
url
=
$1
# XXX +cpufreq transition statistics (CPU_FREQ_STAT)
topic
=
$2
# XXX place=?
zhashok
=
$3
topic
=
$1
url
=
$2
# nrun time demo-zbigarray read $url
# nrun time demo-zbigarray read $url
nrun ./zhash.py
--check
=
XXX
--bench
=
$topic
/%s
--
$
hashfunc
$url
nrun ./zhash.py
--check
=
$zhashok
--bench
=
$topic
/%s
--
$z
hashfunc
$url
echo
-e
"
\n
#
${
Npar
}
clients in parallel"
echo
-e
"
\n
#
${
Npar
}
clients in parallel"
nrunpar ./zhash.py
--check
=
XXX
--bench
=
$topic
/%s-P
$Npar
--
$
hashfunc
$url
nrunpar ./zhash.py
--check
=
$zhashok
--bench
=
$topic
/%s-P
$Npar
--
$z
hashfunc
$url
if
[[
$url
==
zeo://
*
]]
;
then
if
[[
$url
==
zeo://
*
]]
;
then
echo
"(skipping zhash.go on ZEO -- Cgo does not support zeo:// protocol)"
echo
"(skipping zhash.go on ZEO -- Cgo does not support zeo:// protocol)"
return
return
fi
fi
echo
echo
bench_go
$topic
$url
z
bench_go
$topic
$url
}
}
# go-only part of bench
# go-only part of
z
bench
bench_go
()
{
z
bench_go
()
{
topic
=
$1
topic
=
$1
url
=
$2
url
=
$2
nrun ./zhash_go
-check
=
XXX
--bench
=
$topic
/%s
--log_dir
=
$log
-
$
hashfunc
$url
nrun ./zhash_go
-check
=
$zhashok
--bench
=
$topic
/%s
--log_dir
=
$log
-
$z
hashfunc
$url
nrun ./zhash_go
-check
=
XXX
--bench
=
$topic
/%s
--log_dir
=
$log
-
$
hashfunc
-useprefetch
$url
nrun ./zhash_go
-check
=
$zhashok
--bench
=
$topic
/%s
--log_dir
=
$log
-
$z
hashfunc
-useprefetch
$url
echo
-e
"
\n
#
${
Npar
}
clients in parallel"
echo
-e
"
\n
#
${
Npar
}
clients in parallel"
nrunpar ./zhash_go
-check
=
XXX
--bench
=
$topic
/%s-P
$Npar
--log_dir
=
$log
-
$
hashfunc
$url
nrunpar ./zhash_go
-check
=
$zhashok
--bench
=
$topic
/%s-P
$Npar
--log_dir
=
$log
-
$z
hashfunc
$url
}
}
...
@@ -824,37 +825,39 @@ cmd_bench-local() {
...
@@ -824,37 +825,39 @@ cmd_bench-local() {
install_trap
install_trap
gen_data
gen_data
zhashok
=
`
cat
$var
/zhash.ok
`
echo
-e
"
\n
*** FileStorage"
echo
-e
"
\n
*** FileStorage"
bench
`
hostname
`
/fs1
$fs1
/data.fs
zbench
$fs1
/data.fs
`
hostname
`
/fs1
$zhashok
echo
-e
"
\n
*** ZEO"
echo
-e
"
\n
*** ZEO"
Zpy
$fs1
/data.fs
Zpy
$fs1
/data.fs
bench
`
hostname
`
/zeo zeo://
$Zbind
zbench zeo://
$Zbind
`
hostname
`
/zeo
$zhashok
killall runzeo
killall runzeo
wait
wait
echo
-e
"
\n
*** NEO/py sqlite"
echo
-e
"
\n
*** NEO/py sqlite"
NEOpylite
NEOpylite
bench
`
hostname
`
/neo/py/sqlite neo://
$cluster
@
$Mbind
zbench neo://
$cluster
@
$Mbind
`
hostname
`
/neo/py/sqlite neo://
$cluster
@
$Mbind
$zhashok
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
wait
wait
echo
-e
"
\n
*** NEO/py sql"
echo
-e
"
\n
*** NEO/py sql"
NEOpysql
NEOpysql
bench
`
hostname
`
/neo/py/sql neo://
$cluster
@
$Mbind
zbench neo://
$cluster
@
$Mbind
`
hostname
`
/neo/py/sql neo://
$cluster
@
$Mbind
$zhashok
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
xmysql
-e
"SHUTDOWN"
wait
wait
echo
-e
"
\n
*** NEO/go"
echo
-e
"
\n
*** NEO/go"
NEOgo
NEOgo
bench
`
hostname
`
/neo/go neo://
$cluster
@
$Mbind
zbench neo://
$cluster
@
$Mbind
`
hostname
`
/neo/go
$zhashok
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
wait
wait
echo
-e
"
\n
*** NEO/go (sha1 disabled)"
echo
-e
"
\n
*** NEO/go (sha1 disabled)"
X_NEOGO_SHA1_SKIP
=
y NEOgo
X_NEOGO_SHA1_SKIP
=
y NEOgo
X_NEOGO_SHA1_SKIP
=
y
bench_go
"
`
hostname
`
/neo/go(!sha1)"
neo://
$cluster
@
$Mbind
X_NEOGO_SHA1_SKIP
=
y
zbench_go neo://
$cluster
@
$Mbind
"
`
hostname
`
/neo/go(!sha1)"
$zhashok
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
wait
wait
...
@@ -1020,7 +1023,7 @@ cmd_run-client() {
...
@@ -1020,7 +1023,7 @@ cmd_run-client() {
url
=
$2
url
=
$2
test
-z
"
$topic
"
-o
-z
"
$url
"
&&
die
"Usage: neotest run-client <topic> <url>"
test
-z
"
$topic
"
-o
-z
"
$url
"
&&
die
"Usage: neotest run-client <topic> <url>"
test
-z
"
$goonly
"
&&
bench
$topic
$url
||
bench_go
$topic
$url
test
-z
"
$goonly
"
&&
zbench
$topic
$url
||
z
bench_go
$topic
$url
}
}
# command: benchmark local disk
# command: benchmark local disk
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment