Project comparing the performance of web servers implemented in a small subset of programming languages.
APACHE-2.0 License
v2.0.0 - For a detailed documentation of the changes, please see the change log.
This project is focused on comparing the performance of web servers implemented in a small subset of programming languages. The project currently has benchmarks for:
A comparison between the languages can be found in the benchmark.
The HTTP API of the web server is defined in the following chapters, and the benchmark will run each of these API aspects in sequence.
Route returning empty responses back to the client. This benchmark is focused on determining the performance of the web server and its efficiency in handling the request and response pipeline.
The following HTTP API should be implemented by the web server.
GET /health HTTP/1.1
204 No Content
Route echoing a text back to the client. This benchmark is focused on reading incoming requests and return responses based on the parameters in the request URI.
The following HTTP API should be implemented by the web server.
GET /echo/{text} HTTP/1.1
200 OK
Content-Type: text/plain
{text}
Route acting as a relay between a client and another service on the network. This benchmark reads URI parameters, i.e. keys, from incoming requests, passes the keys on to a key/value service, and then responds with the keys and their values to the client. It highlights latency penalties associated with service dependencies.
The key/value service is already implemented, and has the following HTTP API.
GET /store/{key} HTTP/1.1
200 OK
Content-Type: application/json
{
"value": "{value}"
}
The following HTTP API should be implemented by the web server.
The relay service is dependent on the key/value service, and the implementation of the relay service should expect that the following environment variables are set.
Name | Description |
---|---|
Relay_KeyValueServiceHostname | The hostname or IP address of the key/value service |
Relay_KeyValueServicePort | The port of the key/value service |
GET /relay/{key} HTTP/1.1
The key should be used in a request to the key/value service.
200 OK
Content-Type: application/json
{
"key": "{key}",
"value": "{value}"
}
Routes describing a standard CRUD application that stores its state in a database. This benchmark is focused on database operations and highlights latency penalties associated with using a database.
The database has the following schema.
CREATE TABLE contact
(
id integer NOT NULL DEFAULT nextval('contact_id_seq'::regclass),
firstname character varying,
surname character varying,
CONSTRAINT contact_pkey PRIMARY KEY (id)
)
The following HTTP API should be implemented by the web server.
The contacts service is dependent on a database, and the implementation of the service should expect that the following environment variables are set.
Name | Description |
---|---|
Contacts_DatabaseHost | The host of the database |
Contacts_DatabaseName | The name of the database |
Contacts_DatabaseUsername | The username used when connecting to the database |
Contacts_DatabasePassword | The password used when connecting to the database |
POST /contacts HTTP/1.1
Content-Type: application/json
{
"firstName": "{firstName}",
"surname": "{surname}"
}
201 Created
Content-Type: application/json
Location: http://{hostname}:{port}/contacts/{id}
{
"id": {id},
"firstName": "{firstName}",
"surname": "{surname}"
}
GET /contacts/{id} HTTP/1.1
200 OK
Content-Type: application/json
{
"id": {id},
"firstName":"{firstName}",
"surname":"{surname}"
}
GET /contacts HTTP/1.1
200 OK
Content-Type: application/json
[
{
"id": {id},
"firstName":"{firstName}",
"surname":"{surname}"
}
]
DELETE /contacts/{id} HTTP/1.1
204 No Content