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
Show 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
# 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 use `go run ...` so it does not need go install?
...
...
@@ -230,16 +230,17 @@ GENsql() {
touch
$var
/generated.sql
}
# generate all test databases
gen_data
()
{
GENfs
GENsqlite
GENsql
wait
sync
}
# ---- main driver ----
# data/versions
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
# ---- main driver ----
# pyver <egg> (<showas>) - print version of egg
pyver
()
{
...
...
@@ -258,18 +259,22 @@ pyver() {
test
"
$gitver
"
!=
""
&&
ver
=
"
$gitver
"
||
ver
=
"
$pyver
"
printf
"# %-16s: %s
\n
"
"
$showas
"
"
$ver
"
}
pyver neoppod neo
pyver zodb
pyver zeo
pyver mysqlclient
pyver wendelin.core
# generate test databases
GENfs
GENsqlite
GENsql
wait
sync
# show data/versions
header
()
{
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 neoppod neo
pyver zodb
pyver zeo
pyver mysqlclient
pyver wendelin.core
}
# build go client
# (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
Nrun
=
4
# repeat benchmarks N time
Npar
=
8
# run so many parallel clients in parallel phase
# nrun ... - run ...
Nrun times
# nrun ... - run ...
$Nrun times serially
nrun
()
{
for
i
in
`
seq
$Nrun
`
;
do
"
$@
"
done
}
#
runpar ... - run several program instances in parallel
runpar
()
{
#
nrunpar ... - run $Npar ... instances in parallel and wait for completion
n
runpar
()
{
local
jobv
for
i
in
`
seq
$Npar
`
;
do
"
$@
"
&
...
...
@@ -298,8 +303,8 @@ runpar() {
#hashfunc=sha1
#hashfunc=adler32
#
hashfunc=crc32
hashfunc
=
null
hashfunc
=
crc32
#
hashfunc=null
# bench <url> - run benchmarks against URL
bench
()
{
...
...
@@ -308,7 +313,7 @@ bench() {
nrun ./zhash.py
--
$hashfunc
$url
# echo -e "\n# ${Npar} clients in parallel"
# runpar ./zhash.py --$hashfunc $url
#
n
runpar ./zhash.py --$hashfunc $url
if
[[
$url
==
zeo://
*
]]
;
then
echo
"(skipping zhash.go on ZEO -- Cgo does not support zeo:// protocol)"
...
...
@@ -325,42 +330,50 @@ bench_go() {
# nrun ./zhash_go --log_dir=$log -$hashfunc -useprefetch $url
# 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"
Zpy
$fs1
/data.fs
bench zeo://
$Zbind
killall runzeo
wait
# benchmark when client and storage are on the same computer
bench_local
()
{
echo
-e
"
\n
*** FileStorage"
bench
$fs1
/data.fs
echo
-e
"
\n
*** NEO/py sqlite
"
NEOpylite
bench neo://
$cluster
@
$M
bind
xneoctl
set
cluster stopping
wait
echo
-e
"
\n
*** ZEO
"
Zpy
$fs1
/data.fs
bench zeo://
$Z
bind
killall runzeo
wait
echo
-e
"
\n
*** NEO/py sql"
NEOpysql
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
wait
echo
-e
"
\n
*** NEO/py sqlite"
NEOpylite
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
wait
echo
-e
"
\n
*** NEO/go"
NEOgo
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
wait
echo
-e
"
\n
*** NEO/py sql"
NEOpysql
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
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
echo
-e
"
\n
*** NEO/go"
NEOgo
bench neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
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
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