-
Notifications
You must be signed in to change notification settings - Fork 842
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
stack setup download incredibly slow #2240
Comments
If I proxy all HTTP traffic through my google cloud instance (running somewhere in europe) then the download speed increases to more than 2Mb/s which makes it possible to setup stack in reasonable time. And I noticed that stack doesn't respect the OS X proxy settings, had to set those explicitly on the command line: |
stack Version 1.2.0, it is still very slow to download the ghc using setup . |
How are any other services running on s3 or amazon working for you? Network links have limited capacity thus if there is someone on your network saturating the same link it could make you slow. |
FWIW I see this issue as well. I'm running |
The problem with GitHub - or more specifically S3 - is that it's not meant to be a CDN. If the Commercial Haskell SIG has an amazon account, they could set up their own S3 + cloudfront distribution to speed this up. |
One workaround would be to install GHC using your system's package manager, and then Stack will pick it up. |
@wereHamster is right, set https_proxy can speed up the download |
Reconnecting your home Internet connection might help, if this gives you a new IP. |
Still a problem. Consider using bittorrent. |
I am having the same issue where downloading GHC is really slow (speeds of < 10 KB/sec). Also, it takes forever to update the package index, it's stuck on the below step for hours.
Are there any workarounds? |
Downloading stuck at 50 KiB speed. Receiving objects: 4% (11988/264752), 1.44 MiB | 51.00 KiB/s |
@shreyasbharath @teh-monad I've posted a link up there with a workaround. |
It is possible to manually download and install ghc. Things are a little trickier on windows, as the setup process is more involved, also installing msys and other tools. I, and I think most others that work on stack see consistently good download speeds. So, it is very difficult for us to work on this problem. If you can please try to diagnose what the problem is, that would be helpful. Perhaps it is just due to geographical location? Or is it possible for the code to do something better that will make the download faster?
The problem with this is who will seed? Do we force a particular client? Using bittorrent for things like this is a big can of worms. |
Just add an option for a shell/batch command to run the client.
Like what? Why, for example, Ubuntu doesn't mind sharing their ISOs as torrents? |
Uhh, so all the stack users will seed the torrent? Seems iffy. If you make it opt-in probably few will enable it. If you make it opt-out, we'll frustrate people that don't expect us to start using their upload bandwidth all the time.
I guess so, we'd have to make some assumptions about the arguments these clients expect, where they put the files etc. etc. If you think it's easy, please open a PR adding it as an optional feature.
That's a very different case, I don't think ubuntu has their torrent stuff integrated into an install utility. For example, does apt-get use torrents? I don't think so.. |
probably we should try it with VPN |
Could you use CDN like cloudfront instead of s3(https://s3.amazonaws.com/hackage.fpcomplete.com/)? By the way, GHC(downloads.haskell.org) uses CDN(fasty). |
Agree, using CloudFront would be a good thing to look into. |
I've had stack updating the package index for 8 hours on a fast internet connection. I can't quite tell what's going on, but it seems like my 100Gbs home internet should be plenty fast. |
This can be a big problem in Japan. It really depends on the time of day, but I've had It can be frustrating at work to wait that long to start building the project I'm trying to work on. I think using a CDN would really help. |
Just ran into this as well. Do we know what is causing it? |
For the moment I'm dealing with this on OSX with A better solution would be welcome. |
It looks like there are mirrors for each release at: https://www.haskell.org/ghc/download_ghc_8_2_2.html#linux_x86_64 (8.2.2 for example). I cannot tell if the speeds are much different from GitHub from my current connection... Also, I think that some kind of torrent solution would be great, however, I'm not sure of exact implementation. One way is just to use the preexisting magnet link protocol (magnet://) to open the default torrent client, but I think this should be only activated by a command-line parameter like --torrent or something like that. Of course, it would probably be much easier and possibly faster just to move downloads off of GitHub to, or at least provide, a faster download source. |
Any work around for this? The download is unbearably slow, I'm willing to do download things manually, but I'm not sure how to make stack aware of local tarball. |
+1 from me, almost every time I've tried to get started learning stack, setup has taken several hours and seemed to get stuck, and I've had to kill it. A workaround would be awesome. |
Been testing out stack but its not usable in a commercial environment at the moment because of this, all downloads and installs are slower then sirup, feel like I'm on a modem and I got 1gbit line with amazing connection to both google, amazon and others, I also have a fixed IP. This is an issue you really should focus on. Just installing ghc took 72 minutes for the project and hlint as much as 13 minutes :O |
Is this an issue with the bandwidth of hackage mirrors? If so, would extra mirrors help? I'd be amenable to setting one up assuming the cost can stay bounded for us and that load could be appropriately balanced. The bittorrent idea mentioned up thread might also be a fantastic way to deal with this as it would allow non-organizational support of hackage redundancy. I understand this would probably be a considerable refactor as well, and it may not even belong in stack proper, but rather cabal or something. Thoughts? |
Is the https://s3.amazonaws.com/hackage.fpcomplete.com/ currently inaccessible? From several machines I get this response to
|
I'm having the same problem. @eyeinsky I got the same response. Is it an expected behavior? |
@debug-ito I have no idea, sorry. Even though this issue happens so rarely (for me, maybe once a year), it would be great to get to the bottom of this, and have some easy alternative to use whenever e.g AWS S3 is not accessible (if this is the reason at all). |
@eyeinsky I used the following mirrors by Tsinghua University, and it worked well. |
I've been experiencing similar problems, although not quite as bad as @kim's (over at #5471). In hopes of seeing a pattern, I've setup a script that periodically downloads ghc from GitHub. To establish a baseline, it first downloads a Xubuntu ISO from a server outside the country. It subsequently downloads GHC. Here's the raw data collected so far. Plotted: (This would have been nicer as a scatter plot, but I couldn't quickly figure out how to do that properly.) A few things to note:
This is on my home connection, but I've seen similar speeds on office connections and VPSs in proper datacentres. This behavior is worrisome, as Stack sadly remains the only beginner-friendly way to use Haskell on all platforms IMHO. @mgsloan Would it be possible for you or other Stack developers to run these scripts too?
|
@martijnbastiaan maybe I'm wrong but it looks like it's something about Github own configuration how it stores release assets. |
You're right, this does seem to be an issue with GitHub assets @qrilka. I've made a few VPSs around the world to see if geographical location matters at all. The results:
So, it always seems to be fetching from US servers, which is bad. My guess is that smaller ISPs have worse peering agreements, leading to the behavior I and other people in this thread have been seeing.
Yeah, I think Stack should just use https://downloads.haskell.org/~ghc/, which is backed by a proper CDN (Fastly). edit: This commit changed asset fetching from haskell.org to github.com, but no comments. |
@borsboom probably you know the reason GHC is fetched from Github and not Haskell.org? |
GitHub serve files from a single geographical location, severly reducing download speeds for non-US users. Even worse, some (European) ISPs seem to have peering issues limiting download speeds to sub-1 Mbps at times. This commit therefore changes 'stack-setup-2.yaml' to use 'downloads.haskell.org' instead of GitHub Assets. At the time of writing, the former uses a proper CDN (Fastly) to deliver content which should result in consistent speeds around the globe. Discussion on: commercialhaskell/stack#2240
GitHub serves files from a single geographical location, severely reducing download speeds for non-US users. Even worse, some (European) ISPs seem to have peering issues limiting download speeds to sub-1 Mbps at times. This commit changes 'stack-setup-2.yaml' to use 'downloads.haskell.org' instead of GitHub Assets. At the time of writing, the former uses a proper CDN (Fastly) to deliver content which should result in consistent speeds around the globe. Discussion on: commercialhaskell/stack#2240
@qrilka @borsboom I've gone ahead and submitted a PR that changes the URLs to use |
Originally this was because downloads.haskell.org was slow and unreliable. Since then they've done a lot of work on it and put it behind a CDN, so I think that's resolved. Really just historical momentum was keeping us using the github.com mirror. I think switching back to downloads.haskell.org makes sense at this point (if there does turn out to be a problem, we can always switch back). |
Do you think there is a chance that haskell.org would also host binaries of |
GitHub serves files from a single geographical location, severely reducing download speeds for non-US users. Even worse, some (European) ISPs seem to have peering issues limiting download speeds to sub-1 Mbps at times. This commit changes 'stack-setup-2.yaml' to use 'downloads.haskell.org' instead of GitHub Assets. At the time of writing, the former uses a proper CDN (Fastly) to deliver content which should result in consistent speeds around the globe. Discussion on: commercialhaskell/stack#2240
With commercialhaskell/stackage-content#82 merged, Stack now pulls GHC from
I very much care about this issue, as I think it's crucial for Haskell to have a simple and reliable way of building projects on all major platforms. Stack is currently the only way to achieve that, but with this issue present, it's only reliable in the US. @borsboom @qrilka Is there anything I can do to help move this issue along? As I said, I care about this issue and I'm willing to put in work to close it. To properly close the issue we should remove reliance on all non-CDN sources. This is everything I could find:
|
@martijnbastiaan s3 mirror you get by default comes from https://www.stackage.org/haddock/lts-16.31/pantry-0.4.0.2/src/Pantry.html#defaultHackageSecurityConfig |
I found this Stackage GHC mirror. To fix the problem of Stack taking forever to download GHC when
[debug] Downloading from https://github.com/commercialhaskell/ghc/releases/download/ghc-7.10.3-release/ghc-7.10.3-x86_64-fedora24-linux-patch1.tar.xz to /home/mnhthng/.stack/programs/x86\_64-linux/ghc-tinfo6-7.10.3.tar.xz ... Terminate Stack for now with
Peace! |
You could achieve the same just by setting a proper value for setup-info-locations @mnhthng-thms without extra tricks with Stack termination (I guess you meant Stack and not Stackage in "Terminate Stackage for now") |
@qrilka I did specify "The proper value" for setup-info-locations:
- https://mirrors.cloud.tencent.com/stackage/stack-setup.yaml Thanks for suggesting! |
's3.amazonaws.com' is not meant to serve clients around the world, as it is hosted in the US only. This causes bandwidth to be severely throttled for, amongst others, European users. This has been observed by users in the following issue: commercialhaskell/stack#2240 At some periods, bandwidth drops to effectively zero, rendering Stack unusable. Measurements can be found here: commercialhaskell/stack#2240 (comment) 'hackage.haskell.org' is served from Fastly's CDN, therefore mitigating these issues.
's3.amazonaws.com' is not meant to serve clients around the world, as it is hosted in the US only. This causes bandwidth to be severely throttled for, amongst others, European users. This has been observed by users in the following issue: commercialhaskell/stack#2240 At some periods, bandwidth drops to effectively zero, rendering Stack unusable. Measurements can be found here: commercialhaskell/stack#2240 (comment) 'hackage.haskell.org' is served from Fastly's CDN, therefore mitigating these issues.
An additional advantage to @m1nhtu99-hoan9's suggestion is that it permits using |
I am closing this issue as Stack gets modern versions of GHC from downloads.haskell.org. |
@mpilgrem : I notice the issue is still open. Maybe you forget to hit the "Close" button? |
I'm trying to setup stack but trying to download GHC is very slow. I'm getting less than 10Kb/s, but my internet connection is capable of much faster speeds. fast.com reports 21Mb/s. Using Chrome or curl to download the GHC release directly from GitHub (/commercialhaskell/ghc/releases/) is equally slow.
stack version: 1.0.4.3 x86_64
The text was updated successfully, but these errors were encountered: