{"id":13575396,"url":"https://github.com/Glorf/lear","last_synced_at":"2025-04-04T22:30:58.528Z","repository":{"id":145289135,"uuid":"162103117","full_name":"Glorf/lear","owner":"Glorf","description":"Linux Engine for Asset Retrieval - speed-profiled C HTTP server","archived":false,"fork":false,"pushed_at":"2019-01-10T09:35:56.000Z","size":2287,"stargazers_count":168,"open_issues_count":8,"forks_count":8,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-05T11:42:22.911Z","etag":null,"topics":["asynchronous","concurrency","http","httpd","https","server"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Glorf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-17T09:06:12.000Z","updated_at":"2024-09-25T11:44:17.000Z","dependencies_parsed_at":"2024-01-07T09:33:11.793Z","dependency_job_id":"4660eb88-97c9-4ed2-98c4-8451d1f05e95","html_url":"https://github.com/Glorf/lear","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glorf%2Flear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glorf%2Flear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glorf%2Flear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glorf%2Flear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glorf","download_url":"https://codeload.github.com/Glorf/lear/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260391,"owners_count":20909998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","concurrency","http","httpd","https","server"],"created_at":"2024-08-01T15:01:00.612Z","updated_at":"2025-04-04T22:30:54.223Z","avatar_url":"https://github.com/Glorf.png","language":"C","readme":"# LEAR - Linux Engine for Asset Retrieval\n\n[![Build Status](https://travis-ci.org/Glorf/lear.svg?branch=master)](https://travis-ci.org/Glorf/lear)\n\n## Description\nLEAR is a simple HTTP server designed to be as simple and fast as possible to achieve one task:\nserve static resources with amazing efficiency. Currently the project is in its early stage,\nbut is gaining momentum and features.\n## Architecture\nWhile being small and lightweight, LEAR is as concurrent and non-blocking as possible.\nIt also uses state-of-the-art technologies and solutions to achieve its task: serve your assets\nrapidly. It features:\n* Multiprocess architecture of traffic handler, using Linux \u003e3.9's `SO_REUSEPORT`\n* Epoll queue for each worker\n* Fully non-blocking architecture of network IO with dynamically allocated read and write buffers\n* Lots of customization through user-friendly YAML properties file\n## Features\n* LEAR accomplishes its task by implementing GET, HEAD, and OPTIONS methods of HTTP/1.1\n* Its non-blocking nature and concurrence-by-design makes responses incredibly fast and processing very efficient\n* Server implements the most common response status codes and offers response body customization (eg. custom 404 error pages for error verbosity and SPA routers)\n* Server parses headers properly and returns Content-Length with any request\n* Requested resources are mmapes, so LEAR has fast direct access to them\n* Custom string format and lack of standard C null-terminated string makes server safe from memory retrieval attacks\n\n## Installation\n* Prerequisites: CMake, GCC, libyaml\n* Installation\n\n\n    ```bash\n    $ git clone https://github.com/Glorf/lear.git\n    $ cd lear\n    $ cmake .\n    $ make install\n    $ cd bin\n    # now modify httpd.yaml to suit your needs\n    $ ./lear\n\n## Customization\nhttpd.yaml offers you all the options currently available - there are no console switches.\nI believe that at this moment these settings are self-explanatory. We'll do full configs\nrewrite soon, config documentation is planned to appear afterwards.\n\n## FAQ\n#### Why is LEAR faster than nginx/apache...\nBecause LEAR is small and simple. LEAR does one task - serve static pages - and does it well.\nIt also implements only a small subset of the HTTP, which makes it incomplete in the sense\nof being standard-compilant, but also very fast in the sense of real life use.\n#### You said it's fast but actually it's slow on big files\nLEAR caching support is WIP. When it's ready, we hope it'll outperform most common\nHTTP engines\n#### Why is X unsupported?\nBecause LEAR started in October 2018 - so it's quite a young project isn't it? If you like C,\nplease help us in development by accomplishing some task from the\n[Github Issues page](https://github.com/Glorf/lear/issues). If you prefer not to\n- just be patient.\n#### Should I use it in my production environment?\n**No.** In its current status, LEAR is extremely incomplete, even for simplest deployments.\n Its security has also not yet been checked by any means. Please, keep us in mind and return\n in few months - we're sure LEAR will be your next production server then.\n\n## Benchmark\nAs development is in early stage, this benchmark is just a performance profiling tool\nfor me, and maybe significant information for people who like this project. It will\nbe updated recently when any performance-related changes happen. Logging is currently\ndisabled in LEAR while benchmarking. Also, please, do not believe these benchmarks.\nIt's just the result of some code run on my laptop, running default, non-tuned nginx,\nyou know. If you have any results to share, please, submit a PR to this readme!\n\n#### ApacheBench 2.3 results\n\n| Method | Keep-alive? | File size [B] | Number of requests | Concurrency level | LEAR master [rps] | NGINX 1.5.15 [rps] |\n|--------|-------------|---------------|--------------------|-------------------|-------------------|--------------------|\n| GET    | Yes         | 865           | 1000000            | 100               | **98885.12**      | 62859.55           |\n| GET    | Yes         | 865           | 1000000            | 1                 | **27786.05**      | 21591.06           |\n| GET    | Yes         | 2229306       | 10000              | 100               | 760.80            | **1821.60**        |\n| GET    | Yes         | 2229306       | 10000              | 1                 | 781.60            | **1508.20**        |\n\n## TODO\nIf you like this project, feel free to contribute, fork and send PRs! Current, non-finished\nlist of feature requests is available on Github Issues page. Remember to keep straight KISS rule - LEAR is\nnever going to be RFC-complete as it's designed just to serve GET responses as fast\nas possible.\n\nPlease, open an issue if you find any bugs or consider any feature that fits the spirit of\nthis project.\n\n## License\nLEAR is distributed for free as a source code, under the permissive MIT license.\n","funding_links":[],"categories":["C","Security","Hardening"],"sub_categories":["WebServers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGlorf%2Flear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGlorf%2Flear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGlorf%2Flear/lists"}