Skip to content

Instantly share code, notes, and snippets.

setup:
- !Ubuntu trusty
- !UbuntuUniverse # needed for a2ps
- !Sh "dpkg --add-architecture i386"
- !Install ["libc6:i386", "cups-client"]
- !Install ["ghostscript", "a2ps"]
- !EnsureDir "/usr/share/cups/model"
- !Sh "dpkg -i brdcp7030lpr-2.0.2-1.i386.deb"
- !Sh "dpkg -i cupswrapperDCP7030-2.0.2-1.i386.deb"
loop {
let mut buf = new_buffer();
try!(read_request(&mut buf));
let parsed = try!(parse_request(&buf));
let value = try!(process_request(&parsed));
try!(send_response(&value));
}
enum FSM {
Reading(Buf),
Processing(Parsed),
Sending(OutBuf),
Idle,
}
#[derive(PartialEq, Eq, Debug)]
#[must_use]
pub enum Async<M, V> {
Continue(M, V),
Stop,
Timeout(M, SteadyTime),
}
fn ready(self, events: EventSet, context: &mut C)
-> Async<Self, Option<Self>>;
> ./wrk -t8 -c 400 http://127.0.0.1:6754
Running 10s test @ http://127.0.0.1:6754
8 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.01ms 1.41ms 33.06ms 91.36%
Req/Sec 63.02k 18.13k 125.13k 75.50%
5027436 requests in 10.04s, 421.92MB read
Requests/sec: 500565.14
Transfer/sec: 42.01MB
@tailhook
tailhook / vagga.yaml
Created November 17, 2015 21:13
python ubuntu trusty
setup:
- !Ubuntu trusty
- !Install [python]
@tailhook
tailhook / vagga.yaml
Created November 17, 2015 21:14
python alpine
setup:
- !Alpine v3.2
- !Install [python]
@tailhook
tailhook / Dockerfile
Created November 17, 2015 21:17
docker python
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y python
setup:
- !Install [ubuntu]
- !Py3Install
- aiohttp
- pytest