All Projects → Glorf → Lear

Glorf / Lear

Licence: mit
Linux Engine for Asset Retrieval - speed-profiled C HTTP server

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Lear

Scala Async
An asynchronous programming facility for Scala
Stars: ✭ 1,077 (+552.73%)
Mutual labels:  asynchronous, concurrency
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (-0.61%)
Mutual labels:  asynchronous, server
Ea Async
EA Async implements async-await methods in the JVM.
Stars: ✭ 1,085 (+557.58%)
Mutual labels:  asynchronous, concurrency
Falcon
A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
Stars: ✭ 2,058 (+1147.27%)
Mutual labels:  server, asynchronous
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (-30.91%)
Mutual labels:  asynchronous, concurrency
Ewf
Eiffel Web Framework -- Provide a common framework to build easily web server application in Eiffel (portable on various connector and platforms)
Stars: ✭ 34 (-79.39%)
Mutual labels:  server, httpd
Zinc
Zinc HTTP Components is an open-source Smalltalk framework to deal with the HTTP networking protocol.
Stars: ✭ 60 (-63.64%)
Mutual labels:  server, https
Agoo
A High Performance HTTP Server for Ruby
Stars: ✭ 679 (+311.52%)
Mutual labels:  server, https
Tcpbin
Very crude and poorly written HTTP(s) and SMTP bin
Stars: ✭ 85 (-48.48%)
Mutual labels:  server, https
Merecat
Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd
Stars: ✭ 69 (-58.18%)
Mutual labels:  https, httpd
Jdonframework
Domain-Driven-Design Pub/Sub Domain-Events framework
Stars: ✭ 978 (+492.73%)
Mutual labels:  asynchronous, concurrency
Armor
Uncomplicated, modern HTTP server
Stars: ✭ 1,629 (+887.27%)
Mutual labels:  server, https
Go Bootstrap
Easy way to bootstrap a web server in Go (Routing|Middleware|Https)
Stars: ✭ 27 (-83.64%)
Mutual labels:  server, https
Halive
A fast http and https prober, to check which URLs are alive
Stars: ✭ 47 (-71.52%)
Mutual labels:  asynchronous, https
Express
Swift Express is a simple, yet unopinionated web application server written in Swift
Stars: ✭ 855 (+418.18%)
Mutual labels:  asynchronous, server
Vibe Core
Repository for the next generation of vibe.d's core package.
Stars: ✭ 56 (-66.06%)
Mutual labels:  asynchronous, concurrency
Pode
Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
Stars: ✭ 329 (+99.39%)
Mutual labels:  server, https
Rxgo
Reactive Extensions for the Go language.
Stars: ✭ 3,907 (+2267.88%)
Mutual labels:  asynchronous, concurrency
Esa Restlight
ESA Restlight is a lightweight and rest-oriented web framework.
Stars: ✭ 67 (-59.39%)
Mutual labels:  asynchronous, https
Watsonwebserver
Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
Stars: ✭ 125 (-24.24%)
Mutual labels:  server, https

LEAR - Linux Engine for Asset Retrieval

Build Status

Description

LEAR is a simple HTTP server designed to be as simple and fast as possible to achieve one task: serve static resources with amazing efficiency. Currently the project is in its early stage, but is gaining momentum and features.

Architecture

While being small and lightweight, LEAR is as concurrent and non-blocking as possible. It also uses state-of-the-art technologies and solutions to achieve its task: serve your assets rapidly. It features:

  • Multiprocess architecture of traffic handler, using Linux >3.9's SO_REUSEPORT
  • Epoll queue for each worker
  • Fully non-blocking architecture of network IO with dynamically allocated read and write buffers
  • Lots of customization through user-friendly YAML properties file

Features

  • LEAR accomplishes its task by implementing GET, HEAD, and OPTIONS methods of HTTP/1.1
  • Its non-blocking nature and concurrence-by-design makes responses incredibly fast and processing very efficient
  • Server implements the most common response status codes and offers response body customization (eg. custom 404 error pages for error verbosity and SPA routers)
  • Server parses headers properly and returns Content-Length with any request
  • Requested resources are mmapes, so LEAR has fast direct access to them
  • Custom string format and lack of standard C null-terminated string makes server safe from memory retrieval attacks

Installation

  • Prerequisites: CMake, GCC, libyaml

  • Installation

    $ git clone https://github.com/Glorf/lear.git
    $ cd lear
    $ cmake .
    $ make install
    $ cd bin
    # now modify httpd.yaml to suit your needs
    $ ./lear
    
    

Customization

httpd.yaml offers you all the options currently available - there are no console switches. I believe that at this moment these settings are self-explanatory. We'll do full configs rewrite soon, config documentation is planned to appear afterwards.

FAQ

Why is LEAR faster than nginx/apache...

Because LEAR is small and simple. LEAR does one task - serve static pages - and does it well. It also implements only a small subset of the HTTP, which makes it incomplete in the sense of being standard-compilant, but also very fast in the sense of real life use.

You said it's fast but actually it's slow on big files

LEAR caching support is WIP. When it's ready, we hope it'll outperform most common HTTP engines

Why is X unsupported?

Because LEAR started in October 2018 - so it's quite a young project isn't it? If you like C, please help us in development by accomplishing some task from the Github Issues page. If you prefer not to

  • just be patient.

Should I use it in my production environment?

No. In its current status, LEAR is extremely incomplete, even for simplest deployments. Its security has also not yet been checked by any means. Please, keep us in mind and return in few months - we're sure LEAR will be your next production server then.

Benchmark

As development is in early stage, this benchmark is just a performance profiling tool for me, and maybe significant information for people who like this project. It will be updated recently when any performance-related changes happen. Logging is currently disabled in LEAR while benchmarking. Also, please, do not believe these benchmarks. It's just the result of some code run on my laptop, running default, non-tuned nginx, you know. If you have any results to share, please, submit a PR to this readme!

ApacheBench 2.3 results

Method Keep-alive? File size [B] Number of requests Concurrency level LEAR master [rps] NGINX 1.5.15 [rps]
GET Yes 865 1000000 100 98885.12 62859.55
GET Yes 865 1000000 1 27786.05 21591.06
GET Yes 2229306 10000 100 760.80 1821.60
GET Yes 2229306 10000 1 781.60 1508.20

TODO

If you like this project, feel free to contribute, fork and send PRs! Current, non-finished list of feature requests is available on Github Issues page. Remember to keep straight KISS rule - LEAR is never going to be RFC-complete as it's designed just to serve GET responses as fast as possible.

Please, open an issue if you find any bugs or consider any feature that fits the spirit of this project.

License

LEAR is distributed for free as a source code, under the permissive MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].