Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for benchmarking #123

Merged
merged 1 commit into from
Mar 9, 2018
Merged

Conversation

gaborigloi
Copy link
Contributor

Signed-off-by: Gabor Igloi gabor.igloi@citrix.com

@gaborigloi
Copy link
Contributor Author

Example output:

~/s/nbd (benchmark|…) $ make benchmark
jbuilder build @install --dev
./benchmark.sh
+ dd if=/dev/zero of=/tmp/test bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0726483 s, 1.4 GB/s
+ SERVER_PROCESS=9966
+ echo 9966
9966
+ trap stop_server EXIT
+ sudo modprobe nbd
+ _build/default/cli/main.exe serve --no-tls /tmp/test
+ sudo nbd-client -N test localhost /dev/nbd0
Negotiation: main.exe: Server.connect: Starting fixed-newstyle negotiation
..main.exe: Server.serve: Serving new client, read_only = false
size = 100MB
bs=1024, sz=104857600 bytes
+ trap stop_client EXIT
+ sudo hdparm -t /dev/nbd0

/dev/nbd0:
 Timing buffered disk reads: 100 MB in  0.10 seconds = 957.84 MB/sec
+ sudo hdparm -t /dev/nbd0

/dev/nbd0:
 Timing buffered disk reads: 100 MB in  0.10 seconds = 1025.76 MB/sec
+ sudo hdparm -t /dev/nbd0

/dev/nbd0:
 Timing buffered disk reads: 100 MB in  0.08 seconds = 1201.45 MB/sec
+ sudo hdparm -t /dev/nbd0

/dev/nbd0:
 Timing buffered disk reads: 100 MB in  0.09 seconds = 1171.28 MB/sec
+ sudo hdparm -t /dev/nbd0

/dev/nbd0:
 Timing buffered disk reads: 100 MB in  0.09 seconds = 1088.84 MB/sec
+ stop_client
+ sudo nbd-client -d /dev/nbd0
disconnect, sock, done
main.exe: Server.serve: Received NBD_CMD_DISC, disconnecting
+ stop_server
++ jobs -p
+ kill 9966
~/s/nbd (benchmark|…) $ 

Signed-off-by: Gabor Igloi <gabor.igloi@citrix.com>
@coveralls
Copy link

coveralls commented Mar 8, 2018

Coverage Status

Coverage remained the same at 54.785% when pulling d442c3a on gaborigloi:benchmark into 3de1e5d on xapi-project:master.

Copy link
Contributor

@edwintorok edwintorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to look at fio for running more realistic benchmarks, but hdparm is probably good enough as a sanity check to compare various builds.
If in doubt what flags to use for fio look at https://github.com/earlephilhower/ezfio

@gaborigloi
Copy link
Contributor Author

Thanks for mentioning that, I ran it and it took quite long - maybe it's still good to have this faster benchmark with hdparm, but I guess I could mention this in a comment.

@edwintorok
Copy link
Contributor

We could also probably reuse some of the existing benchmarks in xenrt/rage.

@lindig
Copy link
Contributor

lindig commented Mar 9, 2018

Any reason not to merge this? It does no harm and can be improved independently.

@mseri mseri merged commit 247e7c2 into xapi-project:master Mar 9, 2018
@gaborigloi gaborigloi deleted the benchmark branch March 9, 2018 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants