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

question: streaming large responses #49

Closed
rodnaph opened this issue May 13, 2013 · 2 comments
Closed

question: streaming large responses #49

rodnaph opened this issue May 13, 2013 · 2 comments

Comments

@rodnaph
Copy link

rodnaph commented May 13, 2013

i've been using http-kit with compojure (just as a drop in replacement for jetty, no special considerations), but have come across some memory issues when trying to stream large responses (15mb+ email attachments from an imap connection).

jetty handles this fine with the ring response...

{:body (io/input-stream content-stream)}

but http-kit blows the heap (limited to 32mb).

should i look into debugging this further, or is this outside the scope of what http-kit is targeted at?

thanks

@shenfeng
Copy link
Member

jetty and http-kit handle this differently.

http-kit will try to read all the input-stream to memory before write them. jetty will read a little, then write the output.

It's very hard for http-kit to optimise for this scenario. (I have no clue how to do it yet)

If the content-stream is a file, large file is optimised.

{:body big-file}

@rodnaph
Copy link
Author

rodnaph commented May 14, 2013

Ah ok, I suspected it might be doing that.

No problem, as long as I know what's going on. Thanks!

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

No branches or pull requests

3 participants