Not maintained - Compare C++ web server speeds
Shell
Switch branches/tags
Nothing to show
Latest commit 6e304ba Aug 5, 2015 Csaba Csoma Added Proxygen and Whisperlib tests

README.md

Cpp-SpeedTest

Small tests to compare C/C++ web server speeds just to get an idea; it is not meant to be scientific.

Speed test results

Tested some of the servers on a Linux. Previous tests ran under MacOS X almost an order of magnitude slower. It seems that most of the web servers don't implement kqueue (the epoll equivalent on Mac).

Transaction/second results, larger is better:

Library License Min Max Average Notes
CivetWeb MIT 21,428 27,272 25,714 C, No errors
Mongoose GPL v2 21,428 27,272 25,714 C, No errors
nginx (stock) 2c BSD 16,981 23,076 20,000 C, No errors
Proxygen BSD + FB 10,344 16,667 11,392 C++, No errors
CivetWeb C++ wrap MIT 9,473 13,235 12,500 C++, No errors
POCO Boost 5,769 14,285 6,716 C++, No errors
Whisperlib BSD? 5,696 6,250 6,040 C, No errors

Command

Ran 40 times:

siege -q -b -c 100 -r 90 --log=/dev/null http://127.0.0.1:8080/

Test apps

  • CivetWeb C: hello.c on http://127.0.0.1:8080/
  • CivetWeb C++: embedded_cpp.cpp on http://127.0.0.1:8081/example
  • Mongoose: hello_world.c on http://127.0.0.1:8080/
  • POCO: HTTPTimeServer.cpp on http://127.0.0.1:9980/
add-apt-repository ppa:george-edison55/cmake-3.x
apt-get update
apt-get upgrade cmake
./build_cmake.sh -DENABLE_TESTS=ON ..
cmake-build/bin/HTTPLoadTest
  • NGinx: first page after disabling log and gzip on http://127.0.0.1/
  • Whisperlib started with ./http_server_test -base_dir=empty -port=8080

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

Facebook Proxygen

BSD + Facebook blanket patent protection (see discussion)
https://github.com/facebook/proxygen
Depends on Boost 1.51+, wangle, folly and a long slew of other libraries. deps.sh downloaded over 140 packages.
It uses https://github.com/joyent/http-parser

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 the 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

See also