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

Large memory usage when downloading large files #84

Closed
Danielv123 opened this issue Mar 17, 2018 · 6 comments
Closed

Large memory usage when downloading large files #84

Danielv123 opened this issue Mar 17, 2018 · 6 comments

Comments

@Danielv123
Copy link

Every time a download of a large file is initiated (~800 mb) goStatic consumes large amounts of ram for a while.

Every time a request is initiated shows up as red in the top graph. The bottom graph is container memory usage in a range of 0 - 1 GB.

Image

@piranha
Copy link
Owner

piranha commented Mar 18, 2018

Hm, interesting! How do you download a file with gostatic?

@Danielv123
Copy link
Author

Danielv123 commented Mar 18, 2018

I have a folder on my site called "archive", where I store large zips of data. Navigating to http://site/archive gives me a nice interface by default for downloading files, much like how FTP is handled.

@piranha
Copy link
Owner

piranha commented Mar 19, 2018

Okay, but how is gostatic involved in that?

@Danielv123
Copy link
Author

Danielv123 commented Mar 19, 2018

You must have missunderstood what I said. The entire server side part of the download is handled by gostatic. The purple line in the graph above is the memory usage of my gostatic docker container, not FTP or other services. This leads me to think that gostatic is handling something weird, like reading the entire file into memory.

To reproduce:

run sudo docker run -d -p 1935:8043 -v /srv/goStatic:/srv/http --name goStatic pierrezemb/gostatic

Place large zip file in /srv/goStatic

Navigate to localhost:1935/largeFile.zip

Observe memory usage.

@piranha
Copy link
Owner

piranha commented Mar 19, 2018

I think you are looking for https://github.com/PierreZ/goStatic :-)

@Danielv123
Copy link
Author

Whoops, my mistake!

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