huajun07 / codesketcher

Visualise your code in action!
https://main.d1fr5et3wgts3j.amplifyapp.com/
MIT License
0 stars 0 forks source link

chore: add rate limit to POST /executor #69

Closed limanjun99 closed 1 year ago

limanjun99 commented 1 year ago

This PR adds rate limiting to the backend API using api gateway features.

Entire API: 50 requests per second, 25 concurrent requests per second POST /execute: 10 requests per second, 5 concurrent requests per second

Tested by deploying with limits = 1, then spamming requests to /execute:

Screenshot 2023-07-06 at 12 06 10 PM

Future Work

Lower the rate limits further, and add account-based limits for execution, so that users do not share the limit, and we can track and ban users.