Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
7727143a
Commit
7727143a
authored
Sep 18, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fc261214
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
56 deletions
+69
-56
go/neo/t/neobench
go/neo/t/neobench
+69
-56
No files found.
go/neo/t/
t.s
h
→
go/neo/t/
neobenc
h
View file @
7727143a
#!/bin/bash -e
#!/bin/bash -e
# run tests and benchmarks against FileStorage, ZEO and various NEO/py{sql,sqlite}, NEO/go clusters
#
neobench:
run tests and benchmarks against FileStorage, ZEO and various NEO/py{sql,sqlite}, NEO/go clusters
# XXX neo/go - must be `go install'ed`
# XXX neo/go - must be `go install'ed`
# XXX use `go run ...` so it does not need go install?
# XXX use `go run ...` so it does not need go install?
...
@@ -230,16 +230,17 @@ GENsql() {
...
@@ -230,16 +230,17 @@ GENsql() {
touch
$var
/generated.sql
touch
$var
/generated.sql
}
}
# generate all test databases
gen_data
()
{
GENfs
GENsqlite
GENsql
wait
sync
}
# ---- main driver ----
# data/versions
# ---- main driver ----
echo
-n
"# "
;
date
--rfc-2822
echo
-n
"# "
;
grep
"^model name"
/proc/cpuinfo |head
-1
|sed
-e
's/model name\s*: //'
echo
-n
"# "
;
uname
-a
echo
-n
"# "
;
python
--version
echo
-n
"# "
;
go version
echo
-n
"# "
;
mysqld
--version
# pyver <egg> (<showas>) - print version of egg
# pyver <egg> (<showas>) - print version of egg
pyver
()
{
pyver
()
{
...
@@ -258,18 +259,22 @@ pyver() {
...
@@ -258,18 +259,22 @@ pyver() {
test
"
$gitver
"
!=
""
&&
ver
=
"
$gitver
"
||
ver
=
"
$pyver
"
test
"
$gitver
"
!=
""
&&
ver
=
"
$gitver
"
||
ver
=
"
$pyver
"
printf
"# %-16s: %s
\n
"
"
$showas
"
"
$ver
"
printf
"# %-16s: %s
\n
"
"
$showas
"
"
$ver
"
}
}
pyver neoppod neo
pyver zodb
# show data/versions
pyver zeo
header
()
{
pyver mysqlclient
echo
-n
"# "
;
date
--rfc-2822
pyver wendelin.core
echo
-n
"# "
;
grep
"^model name"
/proc/cpuinfo |head
-1
|sed
-e
's/model name\s*: //'
echo
-n
"# "
;
uname
-a
# generate test databases
echo
-n
"# "
;
python
--version
GENfs
echo
-n
"# "
;
go version
GENsqlite
echo
-n
"# "
;
mysqld
--version
GENsql
wait
pyver neoppod neo
sync
pyver zodb
pyver zeo
pyver mysqlclient
pyver wendelin.core
}
# build go client
# build go client
# (we run it several times and in parallel - for go build not to infere with benchmarking)
# (we run it several times and in parallel - for go build not to infere with benchmarking)
...
@@ -279,15 +284,15 @@ go build -o zhash_go zhash.go
...
@@ -279,15 +284,15 @@ go build -o zhash_go zhash.go
Nrun
=
4
# repeat benchmarks N time
Nrun
=
4
# repeat benchmarks N time
Npar
=
8
# run so many parallel clients in parallel phase
Npar
=
8
# run so many parallel clients in parallel phase
# nrun ... - run ...
Nrun times
# nrun ... - run ...
$Nrun times serially
nrun
()
{
nrun
()
{
for
i
in
`
seq
$Nrun
`
;
do
for
i
in
`
seq
$Nrun
`
;
do
"
$@
"
"
$@
"
done
done
}
}
#
runpar ... - run several program instances in parallel
#
nrunpar ... - run $Npar ... instances in parallel and wait for completion
runpar
()
{
n
runpar
()
{
local
jobv
local
jobv
for
i
in
`
seq
$Npar
`
;
do
for
i
in
`
seq
$Npar
`
;
do
"
$@
"
&
"
$@
"
&
...
@@ -298,8 +303,8 @@ runpar() {
...
@@ -298,8 +303,8 @@ runpar() {
#hashfunc=sha1
#hashfunc=sha1
#hashfunc=adler32
#hashfunc=adler32
#
hashfunc=crc32
hashfunc
=
crc32
hashfunc
=
null
#
hashfunc=null
# bench <url> - run benchmarks against URL
# bench <url> - run benchmarks against URL
bench
()
{
bench
()
{
...
@@ -308,7 +313,7 @@ bench() {
...
@@ -308,7 +313,7 @@ bench() {
nrun ./zhash.py
--
$hashfunc
$url
nrun ./zhash.py
--
$hashfunc
$url
# echo -e "\n# ${Npar} clients in parallel"
# echo -e "\n# ${Npar} clients in parallel"
# runpar ./zhash.py --$hashfunc $url
#
n
runpar ./zhash.py --$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)"
...
@@ -325,42 +330,50 @@ bench_go() {
...
@@ -325,42 +330,50 @@ bench_go() {
# nrun ./zhash_go --log_dir=$log -$hashfunc -useprefetch $url
# nrun ./zhash_go --log_dir=$log -$hashfunc -useprefetch $url
# echo -e "\n# ${Npar} clients in parallel"
# echo -e "\n# ${Npar} clients in parallel"
# runpar ./zhash_go --log_dir=$log -$hashfunc $url
#
n
runpar ./zhash_go --log_dir=$log -$hashfunc $url
}
}
echo
-e
"
\n
*** FileStorage"
bench
$fs1
/data.fs
echo
-e
"
\n
*** ZEO"
# benchmark when client and storage are on the same computer
Zpy
$fs1
/data.fs
bench_local
()
{
bench zeo://
$Zbind
echo
-e
"
\n
*** FileStorage"
killall runzeo
bench
$fs1
/data.fs
wait
echo
-e
"
\n
*** NEO/py sqlite
"
echo
-e
"
\n
*** ZEO
"
NEOpylite
Zpy
$fs1
/data.fs
bench neo://
$cluster
@
$M
bind
bench zeo://
$Z
bind
xneoctl
set
cluster stopping
killall runzeo
wait
wait
echo
-e
"
\n
*** NEO/py sql"
echo
-e
"
\n
*** NEO/py sqlite"
NEOpysql
NEOpylite
bench neo://
$cluster
@
$Mbind
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
wait
wait
echo
-e
"
\n
*** NEO/go"
echo
-e
"
\n
*** NEO/py sql"
NEOgo
NEOpysql
bench neo://
$cluster
@
$Mbind
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
wait
xmysql
-e
"SHUTDOWN"
wait
echo
-e
"
\n
*** NEO/go (sha1 disabled)"
echo
-e
"
\n
*** NEO/go"
X_NEOGO_SHA1_SKIP
=
y NEOgo
NEOgo
X_NEOGO_SHA1_SKIP
=
y bench_go neo://
$cluster
@
$Mbind
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
wait
wait
echo
-e
"
\n
*** NEO/go (sha1 disabled)"
X_NEOGO_SHA1_SKIP
=
y NEOgo
X_NEOGO_SHA1_SKIP
=
y bench_go neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
wait
}
header
()
gen_data
()
bench_local
()
# all ok
# all ok
trap
- EXIT
trap
- EXIT
...
...
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