Struct mini_http::Server [] [src]

pub struct Server { /* fields omitted */ }

Methods

impl Server
[src]

[src]

Initialize a new default Server to run on addr

[src]

Configure tcp_nodelay setting for each server socket. Default: false

From mio::net::TcpStream docs:

Sets the value of the TCP_NODELAY option on this socket. If set, this option disables the Nagle algorithm. This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets.

Note: tcp_nodelay(true) will significantly improve performance for benchmarking loads, but may not be necessary for real world usage. For example on my laptop, wrk -t2 -c100 increases from 2.5k to 92k req/s.

[src]

Configure the size of the thread pool that's used for executing handlers

Defaults to num_cpus * 8. If zero is specified, unlimited threads will be spawned instead of using a thread pool.

[src]

Configure keep-alive timeout in seconds

Defaults to 5 seconds

[src]

Start the server using the given handler function