• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    C
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Volley is a benchmarking tool for measuring the performance of server networking stacks.

Volley

Volley is a benchmarking tool for measuring the performance (latency in particular) of server networking stacks. It can be used to determine the performance of the lower levels of the stack (i.e. the kernel), of the server application's programming language abstractions for sockets, or of the libraries and code running within the application.

Volley spawns a configurable number of concurrent clients that all connect to the server, and then performs ping-pong-like single-word operations with the server to gather statistics. It will continue doing so for as many iterations as it takes to produce statistically relevant results.

Goals

Volley can be used to benchmark many things, but I believe there are two main categories of servers that are of interest. In particular, I envision that there will be at least two implementations for every language represented in Volley: one that is idiomatic, and one that is optimized. Comparing the idiomatic solutions' performance is interesting in and of itself, and comparing the optimized solutions might yield insights into how well-suited a particular language is for doing high-performance networking.

I say at least two, because there might be other interesting designs to explore. For example, does the conventional wisdom that having a worker pool improves performance actually still hold? What is the performance difference between a forking and a threaded server? What is the performance difference between asynchronous and synchronous I/O?

Preliminary results

Running the volley benchmarks on an 80-core machine running Linux 3.16 with 40, 80 and 200 clients distributed across 40 cores yields the results given in the graph below. Error bars denote the 99% confidence interval. The benchmark machine has four NUMA nodes, each with 10 cores.

performance plot

To reproduce, run:

benchmark/ $ experiment -r $(PWD)/..
benchmark/ $ grep us 'out/*/run-1/stdout.log' | sed 's@/run-[^/]*/stdout.log@@' | tr '/:-' '\t' | awk '{printf $2; for (i=3;i<NF-4;i++){printf "-"$i} for (i=NF-4;i<=NF;i++){printf " "$i} print ""}'

And plot using the R script in benchmark/plot.R. Experiment can be found here.

Contributing servers

Please submit PRs adding a directory to servers/. The name of the directory should be indicative of what server is being tested. The directory should contain a Makefile that has (at least) two targets:

  • a target with the same name as the directory. this rule should produce an executable binary with that name in the current directory.
  • a clean rule, which is called whenever the top-level clean target is invoked.

The binary accepts a single, mandatory flag, -p, which names a TCP port. The server should listen on this port for incoming requests. For every established connection, the server behaviour should be as follows:

  1. read 4 bytes from the connection
  2. parse the 4 bytes into a 32 bit integer using network byte order
  3. if the integer is zero, the server should terminate
  4. add one to the integer, wrapping around if necessary
  5. write the integer as 4 bytes in network byte order to the connection
  6. go to step 1.

If a connection is closed, the server should continue waiting for new connections. If the server receives a SIGTERM, it should terminate at its earliest convenience (i.e. it should not block indefinitely waiting for new connctions).

To verify that your server works correctly, run the follwoing commands:

volley/ $ make
volley/ $ ./benchmark/bench.sh 1 1 1 target/servers/<your-server>

This should output something akin to:

numactl -C +0-0 /home/.../volley/target/servers/<server> -p 2222
numactl -C 3-3 /home/.../volley/target/<server> -p 2222 -c 1
priming with 1000000 iterations across 1 clients
iteration complete: mean is 9us, stddev is 1.25us
9.04us

You may also see the error:

./benchmark/bench.sh: line 47: kill: (12345) - No such process

This can safely be ignored, and is an artefact of the fact that the server may terminate when it receives a 0 challenge.

Server improvements

If you believe an already implemented server could be improved (either syntactically or semantically), please file an issue detailing the problem, and if possible, submit a PR giving a proposed solution.

More Repositories

1

left-right

A lock-free, read-optimized, concurrency primitive.
Rust
1,940
star
2

inferno

A Rust port of FlameGraph
Rust
1,642
star
3

fantoccini

A high-level API for programmatically interacting with web pages through WebDriver.
Rust
1,085
star
4

configs

My configuration files
Vim Script
968
star
5

bus

Efficient, lock-free, bounded Rust broadcast channel
Rust
668
star
6

flurry

A port of Java's ConcurrentHashMap to Rust
Rust
516
star
7

rust-tcp

A learning experience in implementing TCP in Rust
Rust
488
star
8

rust-imap

IMAP client library for Rust
Rust
477
star
9

evmap

A lock-free, eventually consistent, concurrent multi-value map.
Rust
459
star
10

drwmutex

Distributed RWMutex in Go
Go
323
star
11

rust-ci-conf

Collection of CI configuration files for Rust projects
278
star
12

rustengan

https://fly.io/dist-sys/ in Rust
Rust
260
star
13

roget

Wordle Solver inspired by 3blue1brown
Rust
224
star
14

haphazard

Hazard pointers in Rust.
Rust
193
star
15

griddle

A HashMap variant that spreads resize load across inserts
Rust
188
star
16

stream-cancel

A Rust library for interrupting asynchronous streams.
Rust
155
star
17

wewerewondering

wewerewondering.com
Rust
154
star
18

tsunami

Rust crate for running one-off cloud jobs
Rust
154
star
19

faktory-rs

Rust bindings for Faktory clients and workers
Rust
149
star
20

rust-for-rustaceans.com

Source for https://rust-for-rustaceans.com/
CSS
146
star
21

buzz

A simple system tray application for notifying about unseen e-mail
Rust
129
star
22

msql-srv

Bindings for writing a server that can act as MySQL/MariaDB
Rust
116
star
23

proximity-sort

Simple command-line utility for sorting inputs by proximity to a path argument
Rust
116
star
24

bustle

A benchmarking harness for concurrent key-value collections
Rust
114
star
25

tracing-timing

Inter-event timing metrics on top of tracing.
Rust
112
star
26

stuck

Rust
107
star
27

atone

A `VecDeque` (and `Vec`) variant that spreads resize load across pushes.
Rust
106
star
28

rust-ibverbs

Bindings for RDMA ibverbs through rdma-core
Rust
106
star
29

thesis

My PhD thesis (eventually)
TeX
93
star
30

openssh-rs

Scriptable SSH through OpenSSH in Rust
Rust
92
star
31

superimposer

Python
85
star
32

udp-over-tcp

A command-line tool for tunneling UDP datagrams over TCP.
Rust
84
star
33

tetris-tutorial

From rags to riches; building Tetris with no programming experience.
JavaScript
78
star
34

codecrafters-bittorrent-rust

Rust
78
star
35

orst

Sorting algorithms in Rust
Rust
76
star
36

async-ssh

High-level Rust library for asynchronous SSH connections
Rust
74
star
37

codecrafters-git-rust

Rust
73
star
38

pthread_pool

A simple implementation of thread pooling for C/C++ using POSIX threads
C
71
star
39

arrav

A sentinel-based, heapless, `Vec`-like type.
Rust
68
star
40

streamsh

Download online video streams using shell
Shell
67
star
41

trawler

Workload generator that emulates the traffic pattern of lobste.rs
Rust
66
star
42

async-bincode

Asynchronous access to a bincode-encoded item stream.
Rust
66
star
43

sento

A lock-free, append-only atomic pool.
Rust
65
star
44

hashbag

An unordered multiset/bag implementation backed by HashMap
Rust
64
star
45

cucache

Fast PUT/GET/DELETE in-memory key-value store for lookaside caching
Go
63
star
46

wp2ghost

Convert WordPress XML exports to Ghost JSON import files
JavaScript
58
star
47

vast-vmap

JavaScript library for IAB VAST + VMAP
JavaScript
56
star
48

lox

https://app.codecrafters.io/courses/interpreter
Rust
55
star
49

vote.rs

Simple website for doing multi-round ranked choice voting
Rust
52
star
50

tokio-io-pool

An I/O-oriented tokio runtime thread pool
Rust
48
star
51

hurdles

Rust library providing a counter-based thread barrier
Rust
46
star
52

ordsearch

A Rust data structure for efficient lower-bound lookups
Rust
42
star
53

arccstr

Thread-safe, reference-counted null-terminated immutable Rust strings.
Rust
41
star
54

cliff

Find the load at which a benchmark falls over.
Rust
36
star
55

curb

Run a process on a particular subset of the available hardware.
Rust
35
star
56

bystander

Rust
30
star
57

shortcut

Rust crate providing an indexed, queryable column-based storage system
Rust
30
star
58

hasmail

Simple tray icon for detecting new email on IMAP servers
Go
29
star
59

ornithology

A tool that parses your Twitter archive and highlights interesting data from it.
Rust
28
star
60

rust-zipf

Rust implementation of a fast, bounded, Zipf-distributed random number generator
Rust
26
star
61

minion

Rust crate for managing cancellable services
Rust
24
star
62

cargo-index-transit

A package for common types for Cargo index interactions, and conversion between them.
Rust
24
star
63

streamunordered

A version for futures::stream::FuturesUnordered that multiplexes Streams
Rust
24
star
64

icebreaker

Web app that allows students to ask real-time, anonymous questions during class
Go
23
star
65

mktrayicon

Create system tray icons by writing to a pipe
C
22
star
66

thesquareplanet.com

My homepage
HTML
20
star
67

rust-basic-hashmap

Let's build a HashMap
Rust
20
star
68

obs-do

CLI for common OBS operations while streaming using WebSocket
Rust
20
star
69

gladia-captions

Rust
20
star
70

PHP-Browser

A PHP class to allow scripts to access online resources hidden behind login-forms and other user-interaction measures
PHP
19
star
71

keybase-chat-notifier

Simple desktop notifier for keybase chat
Rust
19
star
72

tokio-byteorder

Asynchronous adapter for byteorder
Rust
19
star
73

python-agenda

Python module for pretty task logging
Python
18
star
74

async-lease

An asynchronous leased value
Rust
17
star
75

yambar-hyprland-wses

Rust
17
star
76

tally

time's prettier cousin
Rust
15
star
77

strawpoll

Rust
15
star
78

async-option

Asynchronous Arc<Mutex<Option<T>>>
Rust
14
star
79

indexmap-amortized

bluss/IndexMap with amortized resizes
Rust
14
star
80

tokio-os-timer

Timer facilities for Tokio based on OS-level primitives.
Rust
14
star
81

cloud-arch

Script for generating Arch Linux cloud images
Shell
13
star
82

cryptsetup-gui

Simple GUI for unlocking cryptsetup volumes
C
13
star
83

guardian

Owned mutex guards for refcounted mutexes.
Rust
12
star
84

rust-at-sunrise

Tool for posting daily updates on the latest available Rust Nightly
Rust
11
star
85

experiment

A tool for running concurrent multi-configuration experiments.
Ruby
11
star
86

mio-pool

A pool of workers operating on a single set of mio connections
Rust
10
star
87

rust-agenda

Simple, pretty CLI progress tracker
Rust
10
star
88

songtext

Simple bash script for retrieving song lyrics.
Shell
10
star
89

skyline

Various implementations of tower::Service
Rust
9
star
90

hanabot

Hanabi Slack bot
Rust
8
star
91

cleaver

Data-flow distribution analyzer
Rust
8
star
92

repackage

A terrible and nerve-inducing tool to rename a crate in a .crate file
Rust
7
star
93

simio

I/O Automata Simulator
Python
7
star
94

cargo-http-bench

Benchmarking suite for Cargo's experimental HTTP registry implementation
Shell
7
star
95

go-iprof

Simple go library for concurrent instrumented profiling.
Go
7
star
96

incomplete

Provides incomplete!(), a compile-time checked version of Rust's unimplemented!() macro
Rust
7
star
97

rucache

Fast PUT/GET/DELETE in-memory key-value store for lookaside caching -- Rust prototype
Rust
6
star
98

throttled-reader

An io::Read proxy that limits calls to read()
Rust
6
star
99

ff-jump-to-tab

A (subjectively) better Ctrl+# experience for Firefox
JavaScript
6
star
100

snavi

Sane navigation enhancement with Javascript
JavaScript
6
star