{"id":20804971,"url":"https://github.com/lichess-org/lila-http","last_synced_at":"2025-05-07T04:20:32.012Z","repository":{"id":39172053,"uuid":"442122170","full_name":"lichess-org/lila-http","owner":"lichess-org","description":"Handle some https://lichess.org/tournament load","archived":false,"fork":false,"pushed_at":"2025-03-01T11:13:19.000Z","size":390,"stargazers_count":36,"open_issues_count":5,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-31T06:11:24.882Z","etag":null,"topics":["lichess"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lichess-org.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}},"created_at":"2021-12-27T10:07:44.000Z","updated_at":"2025-02-09T07:54:00.000Z","dependencies_parsed_at":"2023-12-03T10:35:54.828Z","dependency_job_id":null,"html_url":"https://github.com/lichess-org/lila-http","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lichess-org","download_url":"https://codeload.github.com/lichess-org/lila-http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810931,"owners_count":21807871,"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":["lichess"],"created_at":"2024-11-17T19:12:41.514Z","updated_at":"2025-05-07T04:20:31.988Z","avatar_url":"https://github.com/lichess-org.png","language":"Rust","readme":"## lila-http\n\nTake some of the HTTP load away from lila. WIP!\n\n### Arena tournaments\n\nClients connected to a [tournament page](https://lichess.org/tournament/winter21)\nrequest new data about the tournament every 4s or so, with XHR HTTP requests.\n\nEach player requests information about a different leaderboard page: the one they're in.\n\nWhen a tournament has 17k connected clients, like it happened during the\n[Agadmator Arena](https://lichess.org/@/Lichess/blog/our-recent-server-issues/FdKHVehW),\nthen [lila](https://github.com/ornicar/lila) has to serve about 5k tournament update requests\nper second.\n\nIt's too much. Even tho most of the data is cached by lila, these requests are authenticated\nand have a cost. lila usually serves at most 2k requests per second, and is not designed to\nsuddenly serve 5k/s more.\n\nSo, the plan is to have a new service handle these tournament update requests.\nIt gets info about ongoing tournaments from lila, and propagates it to the clients.\n\n### lila-ws, and now lila-http\n\nMuch like [lila-ws](https://github.com/ornicar/lila-ws) moved the websocket traffic away from lila,\nlila-http handles some of the heavy HTTP traffic.\n\nIt may be expanded to other areas than just the arena tournaments in the future.\n\n### Optional service\n\nOne goal of lila-http is to be optional. Lichess should work just fine without it.\nIt means that lila and lila-http can handle the same requests in the same way.\n\nThis simplifies dev environments, which won't need to install lila-http,\nand makes production more resilient to lila-http restarts or outages.\n\nThis goal is a nice-to-have, not a must-have, and might be dropped in the future\nif it proves to be too inconvenient.\n\n### Why Rust\n\nIt could have been done in scala, like lila-ws. But I saw this as an opportunity to learn rust,\nwhich I know is a fantastic language.\n\n### Why not [language]\n\nI value strong static typing very highly, and both scala and rust have it. Haskell would be an other option.\nGo, not so much.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flichess-org%2Flila-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-http/lists"}