Use io.Copy over ioutil.ReadFile #17
Loading…
Reference in New Issue
No description provided.
Delete Branch "makeworld/molly-brown:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ioutil.ReadFile
is a bad choice for servers, because it means the file is read completely into memory, for each request. This is not only slower than copying the file, but can also cause out-of-memory panics when the server is serving files larger than its available RAM, or files that are smaller but to multiple clients at once.This is why
konpeito.media
goes down sometimes, as cat explained to me on IRC. They also sent me this stack trace, which is what led me to the right lines of code.This is a critical bug for any servers serving larger files. Please merge as early as you can. Maybe announce on the mailing list too? Thanks.
Thanks a lot for this fix! I've merged it just now, I'll tag a new release and make an announcement later tonight.