{"id":42684839,"url":"https://github.com/codepr/llb","last_synced_at":"2026-01-29T12:08:27.102Z","repository":{"id":38080406,"uuid":"248074851","full_name":"codepr/llb","owner":"codepr","description":"Dead simple event-driven load-balancer","archived":false,"fork":false,"pushed_at":"2024-12-12T17:22:50.000Z","size":142,"stargazers_count":33,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-12T18:28:45.918Z","etag":null,"topics":["epoll","event-driven","http","load-balancer","multithreading","networking","simple","small-projects"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codepr.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.sh","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}},"created_at":"2020-03-17T21:16:45.000Z","updated_at":"2024-12-12T17:22:54.000Z","dependencies_parsed_at":"2023-02-15T15:46:28.172Z","dependency_job_id":null,"html_url":"https://github.com/codepr/llb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codepr/llb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fllb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fllb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fllb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fllb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codepr","download_url":"https://codeload.github.com/codepr/llb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codepr%2Fllb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28877134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["epoll","event-driven","http","load-balancer","multithreading","networking","simple","small-projects"],"created_at":"2026-01-29T12:08:25.310Z","updated_at":"2026-01-29T12:08:27.095Z","avatar_url":"https://github.com/codepr.png","language":"C","readme":"llb\n===\n\n![llb CI](https://github.com/codepr/llb/workflows/llb%20CI/badge.svg?branch=master)\n\n(**L**)ittle(**L**)oad(**B**)alancer, a dead simple event-driven load-balancer.\nSupports Linux (and arguably OSX) through epoll and poll/select (kqueue on\nBSD-like) as fallback, it uses an event-loop library borrowed from\n[Sol](https://github.com/codepr/sol.git).\n\nWritten out of boredom/learning purpose (50/50) during self-isolation. Sure\nthing there will be bugs and plenty of corner cases to be addressed.\n\nFeatures:\n\n- Logging\n- Configuration file on disk\n- Basic healthcheck for backends\n- TLS encryption (to be refined)\n- Daemon mode\n- Multithread event-loop\n- HTTP and TCP load-balancing\n- Round-robin, weighted round-robin, hash-balancing, random-balancing,\n  leastconn, leasttraffic\n- Pretty small (~2000 sloc) and little dependencies (openssl)\n\nNext:\n\n- Improvements on all previous points\n\n## Build\n\n**Dependencies**\n\n- gcc\n- make\n- cmake\n- OpenSSL (libssl-dev)\n\n```sh\n$ cmake . \u0026\u0026 make\n```\n\n## Quickstart\n\nBackend servers at http://localhost:8080 and http://localhost:8081, balancing\nstrategy WEIGHTED-ROUND-ROBIN\n\n```sh\n$ ./llb -v -b http://localhost:8080:2,http://localhost:8081:4 -l weighted-round-robin\n```\n\nA simple configuration can be passed in with `-c` flag:\n\n```sh\n$ ./llb -c path/to/llb.conf\n```\n\nAs of now the configuration is very small and self-explanatory, default path is\nlocated to `/etc/llb/llb.conf`:\n\n```sh\n# llb configuration file, uncomment and edit desired configuration\n\n# accepts http | tcp\nmode http\n\n# Load-balancing settings\n\n# Frontends are the endpoint exposed as entry point for connecting clients\nfrontends 127.0.0.1:8789,127.0.0.1:8790,127.0.0.1:8791\n\n# Backends is a pool of server to load-balance requests from clients\nbackends 127.0.0.1:6090,127.0.0.1:6090,127.0.0.1:6090\n\n# Set round robin as balancing algorithm\n# Other options available can be\n# random-balancing | hash-balancing | leastconn | leasttraffic | weighted-round-robin\nload_balancing round-robin\n\n# Logging configuration\n\n# Could be either DEBUG, INFO/INFORMATION, WARNING, ERROR\nlog_level DEBUG\n\nlog_path /tmp/llb.log\n\n# TCP backlog, size of the complete connection queue\ntcp_backlog 128\n\n# TLS certs\n\n#cafile certs/ca.crt\n#certfile certs/alaptop.crt\n#keyfile certs/alaptop.key\n\n# TLS supported versions\n#tls_protocols tlsv1,tlsv1_1,tlsv1_2,tlsv1_3\n```\n\nExecutable accepts some simple arguments, in case of a configuration file\nspecified every setting is overridden by it.\n\n- `-h` print an usage help\n- `-v` enable verbose debug messages\n- `-d` run in daemon mode\n- `-c \u003cpath/to/conf\u003e` specify a configuration path, defaults to `/etc/llb/llb.conf`\n- `-l \u003cload-balancing-algorithm\u003e` specify a load-balancing algorithm to be\n  used. Choices are `round-robin`, `hash`, `random`, `leastconn`, `leasttraffic`\n  and `weighted-round-robin`\n- `-m \u003cmode\u003e` choose the run mode between `tcp` and `http`. Defaults to `http`\n- `-b \u003chost:port:weight\u003e,\u003chost:port:weight\u003e..` add backend machines with a\n  weight associated, it will be ignored for load-balancing algorithms other\n  than `weighted-round-robin`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepr%2Fllb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepr%2Fllb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepr%2Fllb/lists"}