Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit message size #83

Open
joelgibson opened this issue Jan 14, 2023 · 2 comments
Open

Limit message size #83

joelgibson opened this issue Jan 14, 2023 · 2 comments

Comments

@joelgibson
Copy link
Collaborator

This year we saw a few messages of sizes 30-100 MB, due to people base64-encoding audio and video, which crashed the server. (The simple fix was to delete them from the database, restart the server, then go and advise some students on not doing that so much). We could either make the server handle this somehow, or just disallow them. I think we should disallow them - for these cases, the bots can publish a large blob somewhere of their choosing and just link to it, keeping the messages a reasonable size.

In the database at the end of camp (keeping in mind room clearing deletes from the database permanently), there were about 14,000 messages in total, and the the distribution of message sizes (adding the text, image, media, and state fields) was:

≤ 1 kB ≤ 2 kB ≤ 4 kB ≤ 8 kB ≤ 16 kB ≤ 32 kB
92.82 % 96.80 % 98.98 % 99.43 % 99.98 % 100.00 %

There were very few messages in the 16-32 kB range, but these were still somewhat reasonable (for example, a JSON description which looks like it was meant to be fed into a mapping program to display a polyline). So I think that a 64 kB limit on a message size would be reasonable - this would be most easily implemented by limiting the total size of incoming HTTP requests and bot responses to 64 kB.

@goombado
Copy link

Whoopsies sorry about that

@joelgibson
Copy link
Collaborator Author

@goombado All good, if I recall correctly I encouraged you to try - I was interested in what would happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants