Introduced hinsightd HTTP server using Linux io_uring subsystem

A compact hinsightd HTTP server has been published, notable for using the io_uring asynchronous I/O interface provided in the Linux kernel. The server supports the HTTP/1.1 protocol and is designed for low resource consumption while providing much-needed functionality. For example, hinsightd supports TLS, reverse proxying (rproxy), caching of dynamically generated content in the local file system, on-the-fly data compression, connectionless restart, connection of dynamic request handlers using FastCGI and CGI mechanisms. The project code is written in C language and distributed under the BSD license.

To process the configuration, write additions and create request handlers, the ability to use the Lua language is provided, while such handlers can be defined directly in the server configuration file. In the form of plugins, features such as changing the logging format, linking individual logs to virtual hosts, defining a load balancing strategy, HTTP authentication, URL rewriting, and scheduled scheduled work (for example, updating Let's Encrypt certificates) are implemented in the form of plugins.

The server comes with a library for integrating hinsightd functionality into your applications. Hinsightd also includes integrated functionality for sending HTTP requests from the command line, for example, to load a page, you can run "hinsightd -d URL". The server is very compact and takes about 200KB compiled (100KB executable and 100KB shared library). External dependencies include only libc, lua, liburing and zlib, and optionally openssl/libressl and ffcall.

Plans for further development include the ability to store compressed files in the cache, sandbox isolation based on system call filtering and the use of namespaces, bandwidth management (traffic shaping), multithreading, improved error handling and definition of virtual hosts based on masks.

The results of synthetic performance testing (without optimizations in the configuration as is) by the ab utility when running 250 and 500 (in brackets) parallel requests ("ab -k -c 250 -n 10000 http://localhost/"):

  • hinsightd/0.9.17 - 63035.01 requests per second (54984.63)
  • lighttpd/1.4.67 - 53693.29 requests per second (1613.59)
  • Apache/2.4.54 - 37474.10 requests per second (34305.55)
  • Caddy/2.6.2 - 35412.02 requests per second (33995.57)
  • nginx/1.23.2 - 26673.64 requests per second (26172.73)

Source: opennet.ru

Add a comment