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

laminar closing connection on (larger?) files #37

Closed
palica opened this issue Apr 12, 2018 · 2 comments
Closed

laminar closing connection on (larger?) files #37

palica opened this issue Apr 12, 2018 · 2 comments
Labels
Milestone

Comments

@palica
Copy link
Contributor

palica commented Apr 12, 2018

When I am trying to download a file from laminar's archive I am getting this:

This is even directly downloading

wget http://laminar.lxd:8080/archive/fun-prime/89/dev-db/mariadb-10.2.9.tbz2
--2018-04-12 08:29:42--  http://laminar.lxd:8080/archive/fun-prime/89/dev-db/mariadb-10.2.9.tbz2
Resolving laminar.lxd... 127.0.0.1
Connecting to laminar.lxd|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 43209261 (41M)
Saving to: ‘mariadb-10.2.9.tbz2’

mariadb-10.2.9.tbz2                                 8%[========>                                                                                                   ]   3.56M  --.-KB/s    in 0.01s   

2018-04-12 08:29:42 (320 MB/s) - Connection closed at byte 3732424. Retrying.

--2018-04-12 08:29:43--  (try: 2)  http://laminar.lxd:8080/archive/fun-prime/89/dev-db/mariadb-10.2.9.tbz2
Connecting to laminar.lxd|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 43209261 (41M)
Saving to: ‘mariadb-10.2.9.tbz2’

mariadb-10.2.9.tbz2                                20%[====================>                                                                                       ]   8.37M  --.-KB/s    in 0.02s   

2018-04-12 08:29:43 (517 MB/s) - Connection closed at byte 8774615. Retrying.

^C

I am running without proxy, so :8080 is directly laminar listening for requests.

But running with proxy doesn't make it better.

2018-04-12 16:39:16 (602 KB/s) - Connection closed at byte 3404021. Retrying.

How can I help to debug it for you some more?

@ohwgiles
Copy link
Owner

I am not really surprised by this, Laminar doesn’t include the necessary smarts for serving up larger files, it doesn’t matter if you put it behind a proxy or not.

Perhaps it’s not clear enough in the documentation, but my current recommendation is to let the http front proxy handle it completely, that is, define a “location” match on the archive url in nginx or apache and have it serve laminar’s archive directory, without any involvement from laminar itself.

I admit it’s not so convenient, and I am probably asking for trouble by allowing basic file serving in the first place, but I didn’t want to reinvent the wheel here.

All that said, now that capnp has http built in it might not be so difficult to do it properly. I’ll probably take another look when I do the next refactor...

@palica
Copy link
Contributor Author

palica commented Apr 12, 2018 via email

@ohwgiles ohwgiles added the bug label Apr 19, 2018
@ohwgiles ohwgiles added this to the 0.7 milestone Apr 20, 2018
geraldolsribeiro pushed a commit to geraldolsribeiro/laminar that referenced this issue Nov 6, 2018
The old implementation slurped the whole artefact into memory, and
did not ensure it remained allocated beyond the first call to write().
The new implementation uses mmap and ensures the mapping lasts until
the file has been delivered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants