-
Notifications
You must be signed in to change notification settings - Fork 34
Strange caching behavior and high memory usage #108
Comments
Hi! From the list of middleware it might be useful to find out whether any of these caches the response body. I would remove some of them, or mount your download endpoint in
Additionaly: I have recently observed that there is also a delay when sending a zip_tricks response inside a Rails context, most likely because the response body that we assign (both zip_tricks and zipline do this) does not get iterated over lazily but instead pre-buffered by Rails. This behavior would be inline with what you are seeing. Maybe @fringd knows more? |
That is: we might need to revert #74 (and the change there makes zip_tricks do the same thing zipline does) |
I was having the same issue with Heroku, after a deep research i figured out that my My gemfile configuration is gem 'rails', '5.2.4'
gem 'puma', '~> 5.6.5'
gem 'rubyzip', '~> 2.3.2'
gem 'zipline', '~> 1.4.0'
gem 'rack', '~> 2.2.4'
gem 'zip_trick', '~> 5.6.0' If you still having issues may be useful take a look this issues. |
FWIW I have also encountered errors using ZipTricks with Rails, but not of my own doing - it seems the entire |
@vassebas @taylorthurlow this should be solved in https://github.com/julik/zip_kit and if you are using zipline it is soon going to use that. |
I'm testing this out on a Heroku dyno, and pointing zipline at some remote file URLs to be zipped. Things are working as expected but memory usage increases significantly and it doesn't seem to be released. I idle around 0.3GB and after a few large downloads I'm at easily 0.8GB, and it doesn't go back to normal at any point.
I'm also observing some strange caching behavior where the initial download takes about as long as expected, but a subsequent download happens much faster. Not immediate, but it looks like it downloads as fast as Heroku can send me data. I'm not seeing any strange middleware in my app:
I might be barking up the wrong tree here, any ideas?
The text was updated successfully, but these errors were encountered: