hackclub / sinerider

💖 A game about love and graphing, built by teenagers.
https://sinerider.com
GNU Affero General Public License v3.0
568 stars 47 forks source link

Work in progress: sinerider-scoring - support at minimum 20 RPM #540

Closed alhardwarehyde closed 1 year ago

alhardwarehyde commented 1 year ago

Description

what it says above

Screenshots

No response

Additional information

No response

grymmy commented 1 year ago

the sinerider-scoring service should, through vertical and/or horizontal scaling (or via using some sort of scalable 3rd party solution), support 20RPM

grymmy commented 1 year ago

we should look into the following:

  1. adding a load balancer on DO
  2. identify the vertical scale of the machine instance type we want to upgrade to (more cpus, SSD disk)
  3. (optional) improve our deployment process if possible (dockerization/machine images/scripts if need be)
  4. provision new instances behind load balancer
  5. perform scoring load test / collect perf numbers

NOTE - this is one potential plan for scaling, please refer to @maxwofford 's prototype and evaluate it as a potential path forward.

JosiasAurel commented 1 year ago

Could get 20 concurrent requests locally using browserless. On DO I couldn't get pass 10 and I think it's due to hardware limits there. I think it's ffmpeg that overflows ram there

So our best bet is browserless and we could get even more.

grymmy commented 1 year ago

Assigned myself this issue alongside Josias. Progress thus far:

  1. Provisioned 3 new DO droplets (note - these are 1VCPU, 1GB RAM instances - original scoring service was 2GB RAM)
  2. Added a load balancer and configured it to point at the new cluster.

This afternoon I will be implementing a script to efficiently deploy to these machines as manually updating the code (like we've been doing w/ the one instance) will waste time & run us into errors.

grymmy commented 1 year ago

Update - we have now deployed the sinerider-scoring service as an App on DO. Instance sizes are 1gb RAM 1VCPU (xsmall). Using our load-testing script we observe these results using the following settings:

Settings:

Results: 21.59 RPM

Results from this test (which did test accuracy as well as perf) did show a small percentage of failed (incorrect) responses. These problems are tracked by issue #534. Results from this test do not properly simulate the load expected from the bot services. At the time of this writing, the Twitter bot (nor the Reddit bot) send parallel requests to the sinerider-scoring service, and this needs to change to leverage the increased throughput in this service. This issue is tracked by #565.