diff --git a/index.html b/index.html index 9f92a124..ef1698d6 100644 --- a/index.html +++ b/index.html @@ -120,7 +120,7 @@
  • mod_nocat : captive portal implementation.
  • -mod_proxy : multi-features reverse proxy support.
  • +mod_proxy : multi-features reverse proxy with websocket support.
  • mod_tsa : server side Time Stamp support.
  • @@ -148,7 +148,7 @@ Algorithmic Complexity Attacks prevention by randomizing hash seed.
  • DNS rebinding prevention by RFC1918 filtering and Host header validation.
  • -
  • support for HTTP Strict Transport Security.
  • +
  • selective uri support (DOS regex) for HTTP Strict Transport Security.
  • Immune to Slow Read DoS attack diff --git a/params.json b/params.json index c0d4dcb2..305d8706 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"body":"ULib - C++ library\r\n==================\r\n\r\nULib is a highly optimized class framework for writing C++ applications. I wrote this framework as my tool for writing applications in various contexts. It is a result of many years of work as C++ programmer. I think, in my opinion, that its strongest points are simplicity, efficiency and sophisticate debugging. This framework offers a class foundation that disables language features that consume memory or introduce runtime overhead, such as rtti and exception handling, and assumes one will mostly be linking applications with other pure C based libraries rather than using the overhead of the standard C++ library and other similar class frameworks. It include as application example a powerful search engine with relative [web interface](https://github.com/stefanocasazza/ULib/blob/master/examples/IR/ir_web.usp) and a multi purpose server (plugin oriented) which results, out of [John Fremlin accurate investigations](http://john.freml.in/ulib-fast-io-framework), to be one of the fastest web application frameworks for serving small dynamic webpages (and also make easier the usage of shell scripts for CGI application)\r\n\r\n\r\nQuickstart\r\n----------\r\n\r\nTake a look at:\r\n\r\n $ ./configure --help\r\n\r\n * ......\r\n * --enable-zip enable build of ZIP support - require libz `[default: use if present libz]`\r\n * --enable-thread enable build of thread support - require libpthread `[default: use if present libpthread]`\r\n * --with-libz use system LIBZ library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-libuuid use system libuuid library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-magic use system libmagic library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-ssl use system SSL library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-pcre use system PCRE library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-expat use system EXPAT library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-ssh use system SSH library - [will check /usr /usr/local]\r\n * --with-curl use system cURL library - [will check /usr /usr/local]\r\n * --with-ldap use system openLDAP library - [will check /usr /usr/local]\r\n * --with-mysql use system MySQL library - [will check /usr /usr/local]\r\n * --with-dbi use system DBI library - [will check /usr /usr/local]\r\n * --with-libevent use system libevent library - [will check /usr /usr/local]\r\n * --with-libxml2 use system libxml2 library - [will check /usr /usr/local]\r\n * --with-page-speed use google page-speed SDK - [will check /usr /usr/local]\r\n * --with-v8-javascript use V8 JavaScript Engine - [will check /usr /usr/local]\r\n\r\nif you desire wrapping of some system library installed.\r\n\r\n\r\n\r\nuserver (`_tcp` | `_ssl` | `_ipc`) application server (`plugin oriented`)\r\n----------------------------------------------------------\r\n\r\nThe current version offers the following features :\r\n\r\n * HTTP/1.0 and 1.1 protocols supported.\r\n * Persistent connections for HTTP/1.1 and Keep-Alive support for HTTP/1.0.\r\n * Browser cache management (headers: If-Modified-Since/Last-modified).\r\n * Chunk-encoding transfers support.\r\n * HTTP multi-range request support.\r\n * Memory caching of document root for (small) static pages with smart gzip compression and CSS/JS reduction.\r\n * Support for automatic update of caching document root with inotify (on Linux).\r\n * Support for pipelining.\r\n * Support for virtual hosts (also with SSL).\r\n * Support for basic/digest authentication.\r\n * Support for directory listings via basic/digest authentication.\r\n * Support for uri protection.\r\n * Support for aliases/redirection.\r\n * Support for switch the site to a maintenance page only.\r\n * Support for overriden of error messages by local document (ErrorDocument/40x|500.html).\r\n * Support for RewriteRule (lighttpd-like) that check for file existence as they do on Apache, some CMS (SilverStripe) require it.\r\n * Support for (apache-like) log [NCSA extended/combined format](http://httpd.apache.org/docs/2.0/mod/mod_log_config.html)\r\n * Support for [JSONRequest](http://json.org/JSONRequest.html).\r\n * Accept HTTP uploads up to 4 GB without increasing memory usage.\r\n * Support for upload progress via USP (ULib Servlet Page).\r\n * General [CGI](http://it.wikipedia.org/wiki/Common_Gateway_Interface) support (run any CGI script) with automatic output compression (using gzip method).\r\n * CGI support for shell script processes (with automatic management of form and cookie).\r\n * CGI support for the X-Sendfile feature and also supports X-Accel-Redirect headers transparently.\r\n * Support for minify HTML CGI output with wrapping [google page speed SDK](http://code.google.com/speed/page-speed/download.html#pagespeed-sdk).\r\n * Support for running JavaScript code with wrapping [google V8 JavaScript Engine](http://code.google.com/apis/v8/intro.html).\r\n * [HTTP pseudo-streaming](http://www.phpmotionwiz.com/what-is-pseudo-streaming) for FLV video managed transparently.\r\n * [C Servlet Support](http://bellard.org/tcc/) with libtcc (if available) as a backend for dynamic code generation (experimental).\r\n * Support for Windows (without preforking).\r\n * Requests cut in phases for modular architecture (apache-like).\r\n * Configuration file with dedicated section.\r\n * Built-in modules :\r\n * `mod_echo` : echo features.\r\n * `mod_rpc` : generic Remote Procedure Call.\r\n * `mod_http` : core features, static file handler and dynamic page (ULib Servlet Page).\r\n * `mod_ssi` : [Server Side Includes]( http://en.wikipedia.org/wiki/Server_Side_Include) support with enhanced #set, direct include and #exec servlet (C/ULib Servlet Page).\r\n * `mod_nocat` : [captive portal](http://nocat.net/) implementation.\r\n * `mod_proxy` : multi-features reverse proxy support.\r\n * `mod_tsa` : server side [Time Stamp](http://www.opentsa.org) support.\r\n * `mod_soap` : generic [SOAP](http://java.sun.com/developer/technicalArticles/xml/webservices) server services support.\r\n * `mod_fcgi` : third-party applications support thru [FastCGI](http://www.fastcgi.com/drupal) interface.\r\n * `mod_scgi` : module that implements the client side of the [SCGI](http://www.mems-exchange.org/software/scgi) protocol (experimental).\r\n * `mod_shib` : [web single sign-on support](http://shibboleth.internet2.edu) (experimental).\r\n * `mod_geoip` : [geolocation support](http://www.maxmind.com/geoip/api/c.shtml) (experimental).\r\n * `mod_stream` : simple streaming support (experimental).\r\n * `mod_socket` : [Web Socket](http://dev.w3.org/html5/websockets) application framework (experimental).\r\n * Security protection :\r\n * [HTTP Session Hijacking](http://cleverlogic.net/articles/kochure) mitigation.\r\n * [Algorithmic Complexity Attacks](http://lwn.net/Articles/474365/) prevention by randomizing hash seed.\r\n * [DNS rebinding](http://en.wikipedia.org/wiki/DNS_rebinding) prevention by RFC1918 filtering and Host header validation.\r\n * support for [HTTP Strict Transport Security](https://developer.mozilla.org/en/Security/HTTP_Strict_Transport_Security).\r\n * Immune to [Slow Read DoS attack](http://code.google.com/p/slowhttptest/)\r\n * [High SSL server quality score](https://www.ssllabs.com/ssltest/analyze.html?d=wifi-aaa.comune.fi.it)\r\n\r\nBenchmarking\r\n------------\r\n\r\n\t$ ./configure && make\r\n\t$ cd tests/examples\r\n\t$ ./benchmarking.sh (or hello_world.sh)\r\n\r\nUse apachebench (ab)\r\n\r\n\t$ ab -n 100000 -c10 http://127.0.0.1/servlet/benchmarking?name=stefano (or)\r\n\t$ ab -n 100000 -c10 http://127.0.0.1/servlet/hello_world\r\n\r\n\r\n[Comparative Benchmarking](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark)\r\n--------------------------------------------------------------------------------------------\r\n\r\nI consider in this benchmark the server [G-WAN 3.2.24 (64 bit)] (http://www.gwan.ch/) and [NGINX 1.1.16] (http://nginx.net/).\r\n\r\ngwan run with the follow options:\r\n---------------------------------\r\n\r\n\t-b: enable the TCP_DEFER_ACCEPT option\r\n\t-d: daemon mode (with an 'angel' process)\r\n\r\nnginx is configured in this way:\r\n--------------------------------\r\n\r\n\tnginx version: nginx/1.1.16\r\n\tTLS SNI support enabled\r\n\tconfigure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid\r\n\t--lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log\r\n\t--http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\r\n\t--http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-ipv6 --with-pcre --with-http_realip_module --with-http_ssl_module\r\n\t--without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module\r\n\r\nnginx run with the follow configuration:\r\n----------------------------------------\r\n\r\n\tuser nginx nginx;\r\n \tworker_processes 2;\r\n \r\n \tevents {\r\n\t\t use epoll;\r\n \t\t worker_connections 1024;\r\n \t\t multi_accept on;\r\n \t}\r\n \r\n \thttp {\r\n\t\tinclude /etc/nginx/mime.types;\r\n\t\tdefault_type application/octet-stream;\r\n\r\n\t\tlog_format main\r\n\t\t\t'$remote_addr - $remote_user [$time_local] '\r\n\t\t\t'\"$request\" $status $bytes_sent '\r\n\t\t\t'\"$http_referer\" \"$http_user_agent\" '\r\n\t\t\t'\"$gzip_ratio\"';\r\n\r\n\t\tclient_header_timeout 10m;\r\n\t\tclient_body_timeout 10m;\r\n\t\tsend_timeout 10m;\r\n\r\n\t\tconnection_pool_size 256;\r\n\t\tclient_header_buffer_size 1k;\r\n\t\tlarge_client_header_buffers 4 2k;\r\n\t\trequest_pool_size 4k;\r\n\r\n \t\tgzip off;\r\n\t\tgzip_min_length 1100;\r\n\t\tgzip_buffers 4 8k;\r\n\t\tgzip_types text/plain;\r\n\r\n\t\toutput_buffers 1 32k;\r\n\t\tpostpone_output 1460;\r\n\r\n \t\terror_log off;\r\n \t\taccess_log off;\r\n\r\n \t\topen_file_cache max=1000 inactive=20s;\r\n \t\topen_file_cache_valid 30s;\r\n \t\topen_file_cache_min_uses 2;\r\n \r\n \t\tserver_tokens off;\r\n\r\n\t\ttcp_nopush on;\r\n\t\ttcp_nodelay on;\r\n\r\n\t\tkeepalive_timeout 75 20;\r\n\r\n\t\tignore_invalid_headers on;\r\n\r\n\t\tindex index.html;\r\n\r\n\t\tserver {\r\n\t\t\tlisten 8080;\r\n\t\t\tserver_name localhost;\r\n\r\n \t\t\taccess_log off;\r\n\t\t\terror_log off;\r\n\r\n \t\t\troot /usr/src/ULib-1.1.0/tests/examples/benchmark/docroot;\r\n\t\t}\r\n \t}\r\n\r\nAll tests are performed on an Intel Pentium 4 2.8 Ghz, Hard drive 5400 rpm, Memory: 2GB DDR2 800MHz running `Gentoo 2.0.3 AMD64 (kernel 3.2.7)`.\r\nYes, this CPU is 11-year old (single-core) P4, but some test on more recent processor (dual-core AMD) give similar results.\r\n\r\nThe client [ab.c](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark/bin/ab.c)\r\nrelies on ApacheBench (ab) and it is a slightly modified version of [G-WAN client](http://gwan.ch/source/ab.c.txt).\r\n\r\nI have considered two scenario for benchmarking:\r\n\r\n * The client as well as the web server tested are hosted on the same computer.\r\n * The client is running on different computer than the web server (networking is involved).\r\n\r\nI had to increase the local port range on client (because of the TIME_WAIT status of the TCP ports).\r\n\r\n * HTTP Keep-Alives: yes/no\r\n * Concurrency: from 0 to 1000, step 10\r\n * Requests: up to 1000000 - within a fixed total amount of time (1 sec)\r\n\r\nFor serving static content I use 3 file of different size:\r\n\r\n * [100.html](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/100.html) (100 bytes - only 'XXX...' without CR/LF)\r\n * [1000.html](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/1000.html) (1000 bytes - only 'XXX...' without CR/LF)\r\n * [WebSocketMain.swf](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/ws/flash-bridge/WebSocketMain.swf) (80K bytes)\r\n\r\nFor serving dynamic content I use a simple request: `Hello {name}`\r\n\r\nuserver_tcp is the winner of this benchmark for almost all level of concurrency.\r\n----------------------------------------\r\n\r\nThe raw data are [here](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark/current).\r\n\r\n![Networking-KeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/net_keep_alive.png?raw=true)\r\n![Networking-NoKeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/net_no_keep_alive.png?raw=true)\r\n![Localhost-KeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/localhost_keep_alive.png?raw=true)\r\n![Localhost-NoKeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/localhost_no_keep_alive.png?raw=true)\r\n\r\n\r\n\r\nMore info\r\n---------\r\n\r\nULib is normally built and installed as a set of shared object libraries and header files. These libraries and headers are installed using directories selected through a \"configure\" script that has been prepared with automake and autoconf. As such, they should build and install similarly to and in a manner compatible and consistent with most other GNU software. ULib is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r\n\r\nComments and suggestions are welcome.\r\n\r\n\tstefano casazza \r\n","google":"","tagline":"C++ application development framework, to help developers create and deploy applications very fast and more simple","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Ulib"} \ No newline at end of file +{"tagline":"C++ application development framework, to help developers create and deploy applications very fast and more simple","body":"ULib - C++ library\r\n==================\r\n\r\nULib is a highly optimized class framework for writing C++ applications. I wrote this framework as my tool for writing applications in various contexts. It is a result of many years of work as C++ programmer. I think, in my opinion, that its strongest points are simplicity, efficiency and sophisticate debugging. This framework offers a class foundation that disables language features that consume memory or introduce runtime overhead, such as rtti and exception handling, and assumes one will mostly be linking applications with other pure C based libraries rather than using the overhead of the standard C++ library and other similar class frameworks. It include as application example a powerful search engine with relative [web interface](https://github.com/stefanocasazza/ULib/blob/master/examples/IR/ir_web.usp) and a multi purpose server (plugin oriented) which results, out of [John Fremlin accurate investigations](http://john.freml.in/ulib-fast-io-framework), to be one of the fastest web application frameworks for serving small dynamic webpages (and also make easier the usage of shell scripts for CGI application)\r\n\r\n\r\nQuickstart\r\n----------\r\n\r\nTake a look at:\r\n\r\n $ ./configure --help\r\n\r\n * ......\r\n * --enable-zip enable build of ZIP support - require libz `[default: use if present libz]`\r\n * --enable-thread enable build of thread support - require libpthread `[default: use if present libpthread]`\r\n * --with-libz use system LIBZ library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-libuuid use system libuuid library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-magic use system libmagic library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-ssl use system SSL library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-pcre use system PCRE library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-expat use system EXPAT library - [will check /usr /usr/local] `[default=use if present]`\r\n * --with-ssh use system SSH library - [will check /usr /usr/local]\r\n * --with-curl use system cURL library - [will check /usr /usr/local]\r\n * --with-ldap use system openLDAP library - [will check /usr /usr/local]\r\n * --with-mysql use system MySQL library - [will check /usr /usr/local]\r\n * --with-dbi use system DBI library - [will check /usr /usr/local]\r\n * --with-libevent use system libevent library - [will check /usr /usr/local]\r\n * --with-libxml2 use system libxml2 library - [will check /usr /usr/local]\r\n * --with-page-speed use google page-speed SDK - [will check /usr /usr/local]\r\n * --with-v8-javascript use V8 JavaScript Engine - [will check /usr /usr/local]\r\n\r\nif you desire wrapping of some system library installed.\r\n\r\n\r\n\r\nuserver (`_tcp` | `_ssl` | `_ipc`) application server (`plugin oriented`)\r\n----------------------------------------------------------\r\n\r\nThe current version offers the following features :\r\n\r\n * HTTP/1.0 and 1.1 protocols supported.\r\n * Persistent connections for HTTP/1.1 and Keep-Alive support for HTTP/1.0.\r\n * Browser cache management (headers: If-Modified-Since/Last-modified).\r\n * Chunk-encoding transfers support.\r\n * HTTP multi-range request support.\r\n * Memory caching of document root for (small) static pages with smart gzip compression and CSS/JS reduction.\r\n * Support for automatic update of caching document root with inotify (on Linux).\r\n * Support for pipelining.\r\n * Support for virtual hosts (also with SSL).\r\n * Support for basic/digest authentication.\r\n * Support for directory listings via basic/digest authentication.\r\n * Support for uri protection.\r\n * Support for aliases/redirection.\r\n * Support for switch the site to a maintenance page only.\r\n * Support for overriden of error messages by local document (ErrorDocument/40x|500.html).\r\n * Support for RewriteRule (lighttpd-like) that check for file existence as they do on Apache, some CMS (SilverStripe) require it.\r\n * Support for (apache-like) log [NCSA extended/combined format](http://httpd.apache.org/docs/2.0/mod/mod_log_config.html)\r\n * Support for [JSONRequest](http://json.org/JSONRequest.html).\r\n * Accept HTTP uploads up to 4 GB without increasing memory usage.\r\n * Support for upload progress via USP (ULib Servlet Page).\r\n * General [CGI](http://it.wikipedia.org/wiki/Common_Gateway_Interface) support (run any CGI script) with automatic output compression (using gzip method).\r\n * CGI support for shell script processes (with automatic management of form and cookie).\r\n * CGI support for the X-Sendfile feature and also supports X-Accel-Redirect headers transparently.\r\n * Support for minify HTML CGI output with wrapping [google page speed SDK](http://code.google.com/speed/page-speed/download.html#pagespeed-sdk).\r\n * Support for running JavaScript code with wrapping [google V8 JavaScript Engine](http://code.google.com/apis/v8/intro.html).\r\n * [HTTP pseudo-streaming](http://www.phpmotionwiz.com/what-is-pseudo-streaming) for FLV video managed transparently.\r\n * [C Servlet Support](http://bellard.org/tcc/) with libtcc (if available) as a backend for dynamic code generation (experimental).\r\n * Support for Windows (without preforking).\r\n * Requests cut in phases for modular architecture (apache-like).\r\n * Configuration file with dedicated section.\r\n * Built-in modules :\r\n * `mod_echo` : echo features.\r\n * `mod_rpc` : generic Remote Procedure Call.\r\n * `mod_http` : core features, static file handler and dynamic page (ULib Servlet Page).\r\n * `mod_ssi` : [Server Side Includes]( http://en.wikipedia.org/wiki/Server_Side_Include) support with enhanced #set, direct include and #exec servlet (C/ULib Servlet Page).\r\n * `mod_nocat` : [captive portal](http://nocat.net/) implementation.\r\n * `mod_proxy` : multi-features reverse proxy with websocket support.\r\n * `mod_tsa` : server side [Time Stamp](http://www.opentsa.org) support.\r\n * `mod_soap` : generic [SOAP](http://java.sun.com/developer/technicalArticles/xml/webservices) server services support.\r\n * `mod_fcgi` : third-party applications support thru [FastCGI](http://www.fastcgi.com/drupal) interface.\r\n * `mod_scgi` : module that implements the client side of the [SCGI](http://www.mems-exchange.org/software/scgi) protocol (experimental).\r\n * `mod_shib` : [web single sign-on support](http://shibboleth.internet2.edu) (experimental).\r\n * `mod_geoip` : [geolocation support](http://www.maxmind.com/geoip/api/c.shtml) (experimental).\r\n * `mod_stream` : simple streaming support (experimental).\r\n * `mod_socket` : [Web Socket](http://dev.w3.org/html5/websockets) application framework (experimental).\r\n * Security protection :\r\n * [HTTP Session Hijacking](http://cleverlogic.net/articles/kochure) mitigation.\r\n * [Algorithmic Complexity Attacks](http://lwn.net/Articles/474365/) prevention by randomizing hash seed.\r\n * [DNS rebinding](http://en.wikipedia.org/wiki/DNS_rebinding) prevention by RFC1918 filtering and Host header validation.\r\n * selective uri support (DOS regex) for [HTTP Strict Transport Security](https://developer.mozilla.org/en/Security/HTTP_Strict_Transport_Security).\r\n * Immune to [Slow Read DoS attack](http://code.google.com/p/slowhttptest/)\r\n * [High SSL server quality score](https://www.ssllabs.com/ssltest/analyze.html?d=wifi-aaa.comune.fi.it)\r\n\r\nBenchmarking\r\n------------\r\n\r\n\t$ ./configure && make\r\n\t$ cd tests/examples\r\n\t$ ./benchmarking.sh (or hello_world.sh)\r\n\r\nUse apachebench (ab)\r\n\r\n\t$ ab -n 100000 -c10 http://127.0.0.1/servlet/benchmarking?name=stefano (or)\r\n\t$ ab -n 100000 -c10 http://127.0.0.1/servlet/hello_world\r\n\r\n\r\n[Comparative Benchmarking](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark)\r\n--------------------------------------------------------------------------------------------\r\n\r\nI consider in this benchmark the server [G-WAN 3.2.24 (64 bit)] (http://www.gwan.ch/) and [NGINX 1.1.16] (http://nginx.net/).\r\n\r\ngwan run with the follow options:\r\n---------------------------------\r\n\r\n\t-b: enable the TCP_DEFER_ACCEPT option\r\n\t-d: daemon mode (with an 'angel' process)\r\n\r\nnginx is configured in this way:\r\n--------------------------------\r\n\r\n\tnginx version: nginx/1.1.16\r\n\tTLS SNI support enabled\r\n\tconfigure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid\r\n\t--lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log\r\n\t--http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\r\n\t--http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-ipv6 --with-pcre --with-http_realip_module --with-http_ssl_module\r\n\t--without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module\r\n\r\nnginx run with the follow configuration:\r\n----------------------------------------\r\n\r\n\tuser nginx nginx;\r\n \tworker_processes 2;\r\n \r\n \tevents {\r\n\t\t use epoll;\r\n \t\t worker_connections 1024;\r\n \t\t multi_accept on;\r\n \t}\r\n \r\n \thttp {\r\n\t\tinclude /etc/nginx/mime.types;\r\n\t\tdefault_type application/octet-stream;\r\n\r\n\t\tlog_format main\r\n\t\t\t'$remote_addr - $remote_user [$time_local] '\r\n\t\t\t'\"$request\" $status $bytes_sent '\r\n\t\t\t'\"$http_referer\" \"$http_user_agent\" '\r\n\t\t\t'\"$gzip_ratio\"';\r\n\r\n\t\tclient_header_timeout 10m;\r\n\t\tclient_body_timeout 10m;\r\n\t\tsend_timeout 10m;\r\n\r\n\t\tconnection_pool_size 256;\r\n\t\tclient_header_buffer_size 1k;\r\n\t\tlarge_client_header_buffers 4 2k;\r\n\t\trequest_pool_size 4k;\r\n\r\n \t\tgzip off;\r\n\t\tgzip_min_length 1100;\r\n\t\tgzip_buffers 4 8k;\r\n\t\tgzip_types text/plain;\r\n\r\n\t\toutput_buffers 1 32k;\r\n\t\tpostpone_output 1460;\r\n\r\n \t\terror_log off;\r\n \t\taccess_log off;\r\n\r\n \t\topen_file_cache max=1000 inactive=20s;\r\n \t\topen_file_cache_valid 30s;\r\n \t\topen_file_cache_min_uses 2;\r\n \r\n \t\tserver_tokens off;\r\n\r\n\t\ttcp_nopush on;\r\n\t\ttcp_nodelay on;\r\n\r\n\t\tkeepalive_timeout 75 20;\r\n\r\n\t\tignore_invalid_headers on;\r\n\r\n\t\tindex index.html;\r\n\r\n\t\tserver {\r\n\t\t\tlisten 8080;\r\n\t\t\tserver_name localhost;\r\n\r\n \t\t\taccess_log off;\r\n\t\t\terror_log off;\r\n\r\n \t\t\troot /usr/src/ULib-1.1.0/tests/examples/benchmark/docroot;\r\n\t\t}\r\n \t}\r\n\r\nAll tests are performed on an Intel Pentium 4 2.8 Ghz, Hard drive 5400 rpm, Memory: 2GB DDR2 800MHz running `Gentoo 2.0.3 AMD64 (kernel 3.2.7)`.\r\nYes, this CPU is 11-year old (single-core) P4, but some test on more recent processor (dual-core AMD) give similar results.\r\n\r\nThe client [ab.c](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark/bin/ab.c)\r\nrelies on ApacheBench (ab) and it is a slightly modified version of [G-WAN client](http://gwan.ch/source/ab.c.txt).\r\n\r\nI have considered two scenario for benchmarking:\r\n\r\n * The client as well as the web server tested are hosted on the same computer.\r\n * The client is running on different computer than the web server (networking is involved).\r\n\r\nI had to increase the local port range on client (because of the TIME_WAIT status of the TCP ports).\r\n\r\n * HTTP Keep-Alives: yes/no\r\n * Concurrency: from 0 to 1000, step 10\r\n * Requests: up to 1000000 - within a fixed total amount of time (1 sec)\r\n\r\nFor serving static content I use 3 file of different size:\r\n\r\n * [100.html](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/100.html) (100 bytes - only 'XXX...' without CR/LF)\r\n * [1000.html](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/1000.html) (1000 bytes - only 'XXX...' without CR/LF)\r\n * [WebSocketMain.swf](https://github.com/stefanocasazza/ULib/tree/master/tests/examples/benchmark/docroot/ws/flash-bridge/WebSocketMain.swf) (80K bytes)\r\n\r\nFor serving dynamic content I use a simple request: `Hello {name}`\r\n\r\nuserver_tcp is the winner of this benchmark for almost all level of concurrency.\r\n----------------------------------------\r\n\r\nThe raw data are [here](https://github.com/stefanocasazza/ULib/tree/master/doc/benchmark/current).\r\n\r\n![Networking-KeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/net_keep_alive.png?raw=true)\r\n![Networking-NoKeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/net_no_keep_alive.png?raw=true)\r\n![Localhost-KeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/localhost_keep_alive.png?raw=true)\r\n![Localhost-NoKeepAlive-498-x-499](https://github.com/stefanocasazza/ULib/blob/master/doc/benchmark/img/AB/localhost_no_keep_alive.png?raw=true)\r\n\r\n\r\n\r\nMore info\r\n---------\r\n\r\nULib is normally built and installed as a set of shared object libraries and header files. These libraries and headers are installed using directories selected through a \"configure\" script that has been prepared with automake and autoconf. As such, they should build and install similarly to and in a manner compatible and consistent with most other GNU software. ULib is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r\n\r\nComments and suggestions are welcome.\r\n\r\n\tstefano casazza \r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Ulib"} \ No newline at end of file