Giter Site home page Giter Site logo

lila-http's Introduction

lila-http

Take some of the HTTP load away from lila. WIP!

Arena tournaments

Clients connected to a tournament page request new data about the tournament every 4s or so, with XHR HTTP requests.

Each player requests information about a different leaderboard page: the one they're in.

When a tournament has 17k connected clients, like it happened during the Agadmator Arena, then lila has to serve about 5k tournament update requests per second.

It's too much. Even tho most of the data is cached by lila, these requests are authenticated and have a cost. lila usually serves at most 2k requests per second, and is not designed to suddenly serve 5k/s more.

So, the plan is to have a new service handle these tournament update requests. It gets info about ongoing tournaments from lila, and propagates it to the clients.

lila-ws, and now lila-http

Much like lila-ws moved the websocket traffic away from lila, lila-http handles some of the heavy HTTP traffic.

It may be expanded to other areas than just the arena tournaments in the future.

Optional service

One goal of lila-http is to be optional. Lichess should work just fine without it. It means that lila and lila-http can handle the same requests in the same way.

This simplifies dev environments, which won't need to install lila-http, and makes production more resilient to lila-http restarts or outages.

This goal is a nice-to-have, not a must-have, and might be dropped in the future if it proves to be too inconvenient.

Why Rust

It could have been done in scala, like lila-ws. But I saw this as an opportunity to learn rust, which I know is a fantastic language.

Why not [language]

I value strong static typing very highly, and both scala and rust have it. Haskell would be an other option. Go, not so much.

lila-http's People

Contributors

dependabot[bot] avatar lakinwecker avatar leodog896 avatar niklasf avatar ornicar avatar soham-pagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.