Go to file
jie b6700ccc0b add array support for db query parameters 2021-08-10 13:58:56 +08:00
bserv add array support for db query parameters 2021-08-10 13:58:56 +08:00
scripts add wrappers for db 2021-08-09 15:07:09 +08:00
.gitignore initial commit 2021-03-05 15:39:47 +08:00
CMakeLists.txt add websocket support & replace promise/future with coroutine 2021-08-07 20:56:19 +08:00
LICENSE Initial commit 2021-03-05 12:27:30 +08:00
README.md add test & update readme 2021-08-08 08:56:35 +08:00
db.sql initial commit 2021-03-05 15:39:47 +08:00
handlers.hpp add wrappers for db 2021-08-09 15:07:09 +08:00
main.cpp add test & update readme 2021-08-08 08:56:35 +08:00

README.md

bserv

A Boost Based High Performance C++ HTTP JSON Server.

Dependencies

Quick Start

Database

You can import the sample database:

  • Create the database in psql:

    create database bserv;
    
  • Create the table in the shell using a sample script:

    psql bserv < db.sql
    

Server & Routing

Configure server & routing in main.cpp.

Handlers

Write the handlers in handlers.hpp

Build

In the shell:

  • Create a directory build, and enter it:
    mkdir build
    cd build
    
  • Run:
    cmake ..
    
  • Build:
    cmake --build .
    

Running

In build, run in shell:

./bserv

Performance

This test is performed by Jmeter. The unit for throughput is Transaction per second.

URL bserv
/login 139.55
/find/<user> 958.77

For /login, we intentionally slow down the attacker's speed.

Computer Hardware:

  • Intel Core i9-9900K x 4
  • 16GB RAM