Minimal benchmark comparing some server languages / stacks
Goal is to return {"statuscode":200,"message":"Hello World!"}
as fast as possible.
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
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
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
Each of the servers were tested using no concurrent requests: ab -n 60000 -c 1 http://localhost:8000/
Requests per second: Response time
Each of the servers were tested using 1000 concurrent requests: ab -n 60000 -c 1000 http://localhost:8000/