Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Not maintained - Compare C++ web server speeds
C C++ Perl Makefile HTML CMake Other
branch: master
Failed to load latest commit information.
component Firt round: mongoose and Poco
src Minor changes, typos
.gitignore List of libraries also considered
.gitmodules Firt round: mongoose and Poco
CMakeLists.txt List of libraries also considered
README.md Added libhttpserver
add-component Minor changes, typos
build-with-gcc Added instructions for Linux
run-siege
start-XCode Added instructions for Linux

README.md

Cpp-SpeedTest

Not maintained!

Short test to compare C++ web server speeds. Written just to get an idea, it is not meant to be scientific.

Results

Throughput after several runs on MacBook Pro laptop (transactions/second - larger is better):

Lib Min Max Average Notes
Mongoose 9,100 11,688 9,700 1-2% error rate
Poco 7,120 9,473 8,300 no errors
nginx 7,142 11,843 8,700 no errors (4 workers, no optimization)
Kore https 357 357 357 no errors
Kore http 4,326 11,588 9,300 no errors (unsupported http mode)
CivetWeb 951 5,625 4,455 cpp, no errors
CivetWeb 1,060 11,688 5,882 c, no errors

All tested using the same command: siege -c 100 -r 90 -b http://127.0.0.1:9090/

Licenses

Other libraries

(In no particular order)

Tested and ruled out several other libraries / frameworks.

I'm looking for smaller free components and ideally should be production quality on Linux and at least development quality on Mac and Windows.

If you think my assessment below is incorrect, please contact me: csabacsoma at gmail.

libasyncd and qhttpd

BSD?
https://github.com/wolkykim/libasyncd
https://github.com/wolkykim/qhttpd
Looks promising, about the same speed as CivetWeb. Based on libevent-dev. Linux only.

whisperlib

BSD?
https://github.com/cpopescu/whisperlib
Around 1,500 transaction/second. Possibly Linux only.

Facebook Proxygen

BSD + Facebook blanket patent protection (see discussion)
https://github.com/facebook/proxygen
Depends on Boost 1.51+, FB thrift and a long slew of other libraries (I counted 86).

libonion

LGPL v3 and (some) AGPL
http://www.coralbits.com/libonion/
Linux only? It does not compile on Mac.

CppCMS

LGPL v3 and commercial
http://cppcms.com/wikipp/en/page/main

Wt

GPL and commercial
http://www.webtoolkit.eu/wt

Klone

BSD
http://www.koanlogic.com/klone/
Targets embedded systems, no Mac support

tntnet

LGPL v3
http://www.tntnet.org/
No CMake support, although there's an attempt. Just for testing I did not wanted to install cxxtools.

Libmicrohttpd

LGPL v2.1
http://www.gnu.org/software/libmicrohttpd/

EasySoap++

http://easysoap.sourceforge.net/
Last update: April 2002

gSOAP

GPL and commercial
http://www.cs.fsu.edu/~engelen/soap.html

ffead-cpp

Apache 2.0
Old: https://code.google.com/p/ffead-cpp/
https://github.com/sumeetchhetri/ffead-cpp
Many "deprecated" and "warning" messages during compile. According to readme it is based on POCO.

staff

Apache 2.0
https://code.google.com/p/staff/
Based on Apache Axis2/C which has 2009 as "Latest Release" date on their website.
Axis2c-unofficial does not seem to have much traction.

WSO2 Web Services Framework

Apache 2.0
http://wso2.com/products/web-services-framework/cpp/
Axis2/C library (see above and on SO)

QT

Large framework

Boost

Large framework

cpp-netlib

Boost
https://github.com/cpp-netlib/cpp-netlib
Boost based

seasocks

BSD
https://github.com/mattgodbolt/seasocks
Runs on Linux only: epoll based (Mac has kqueue instead)
On Linux: 1,198.27 trans/sec vs Kore's 11,688.31 trans/sec

ACE + TAO + JAWS

License: ?
https://github.com/cflowe/ACE
Last commit: Oct 14, 2013

ngnix module

Since NGINX doesn't have a shared module system, it will have to be recompiled every time we want to run the module. Also it ties to app to ngnix.

CPoll CPP

GPL
http://sourceforge.net/projects/cpollcppsp/

Ulib

GPL
https://github.com/stefanocasazza/ULib

Treefrog

BSD
https://github.com/treefrogframework/treefrog-framework
Speed: 18% of ulib

ppC++

GPL
http://sourceforge.net/projects/ppcpp/
Last Update: 2013-03-19

CSP

?
http://www.micronovae.com/CSP.html
Abandoned

libhttpserver

GPL
https://github.com/etr/libhttpserver

Running the tests

Mac OS X

Requirements:

  • Recommended: Homebrew
  • XCode 4.5+ with command line tools (Preferences / Downloads / Components - Install)
  • git: brew install git or GitHub for Mac
  • CMake: brew install cmake
  • Siege: brew install siege

Steps:

  • Clone the repository: git clone https://github.com/csoma/Cpp-SpeedTest.git
  • Run "start-XCode": cd Cpp-SpeedTest; ./start-XCode
  • Select the desired target (Test-Poco, Test-Mongoose)
  • Click Run
  • Recommended: reduce socket time-out to 1sec (see the "run-siege" file)
  • From command line start "run-siege"

Linux

Requirements:

  • Package installer: Ubuntu: apt-get, CentOS/RedHat: yum
  • gcc version 4.7 or later (install instructions below)
  • git: apt-get install git
  • CMake: apt-get install cmake
  • Siege: apt-get install siege

Steps:

  • Clone the repository: git clone https://github.com/csoma/Cpp-SpeedTest.git
  • Run "build-with-gcc": cd Cpp-SpeedTest; ./build-with-gcc
  • Launch the desired server, for example bin/Test-Poco
  • Start "run-siege" on a different terminal

For old Linux distributions

Installing GCC 4.7 or later for C++11 features:

  • Install GCC: apt-get install cmake make gcc g++ libc6-dev libc-dev-bin libpq-dev
  • Check installed version: gcc --version
  • When needed, install gcc-snapshot for a newer version of gcc:
    sudo apt-get install gcc-snapshot
    cd /usr/bin
    mv gcc gcc-old
    mv c++ c++-old
    mv cpp cpp-old
    ln -s /usr/lib/gcc-snapshot/bin/gcc /usr/bin/gcc
    ln -s /usr/lib/gcc-snapshot/bin/c++ /usr/bin/c++
    ln -s /usr/lib/gcc-snapshot/bin/cpp /usr/bin/cpp

See also

Something went wrong with that request. Please try again.