Skip to content

Minimal benchmark comparing some server languages / stacks

Notifications You must be signed in to change notification settings

memen45/server_benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

server_benchmark

Minimal benchmark comparing some server languages / stacks

Goal is to return {"statuscode":200,"message":"Hello World!"} as fast as possible.

C++

Follow the starter project guide: git clone https://github.com/oatpp/oatpp-starter Then build and run.

Follow the README.md in the repository to install dependencies git clone https://gitlab.com/eidheim/Simple-Web-Server Then follow the build steps, afterwards, enable -O2 optimisation:

cd build
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_C_FLAGS_DEBUG="-g -O2" -DCMAKE_CXX_FLAGS_DEBUG="-g -O2" ..
make VERBOSE=1

JavaScript

Follow the guide under examples:

git clone https://github.com/expressjs/express --depth 1
cd express
npm install

Now modify examples/hello-word/index.js

PHP

Using Apache webserver with a simple vhost

<VirtualHost *:8000>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/phptest

        <Directory "/">
          AllowOverride None
        </Directory>
        
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Add Listen 8000 to /etc/apache2/ports.conf to enable port 8000 Add the file /var/www/html/phptest/index.php

Testing

Sequential requests

Each of the servers were tested using no concurrent requests: ab -n 60000 -c 1 http://localhost:8000/

Requests per second: image Response time image

Concurrent requests

Each of the servers were tested using 1000 concurrent requests: ab -n 60000 -c 1000 http://localhost:8000/

Requests per second image

Response time image

About

Minimal benchmark comparing some server languages / stacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published