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

Add haxelib website to cloudflare #33

Open
waneck opened this issue May 11, 2013 · 19 comments
Open

Add haxelib website to cloudflare #33

waneck opened this issue May 11, 2013 · 19 comments

Comments

@waneck
Copy link
Member

waneck commented May 11, 2013

The current haxelib repo server has a very slow internet connection; downloading NME's 60MB zip takes more than 30min!

I can offer to sponsor a server that has better speed to solve this problem; but an easier solution would be to try to use CloudFlare on top of the sever.

CloudFlare is a free CDN (see https://www.cloudflare.com/features-cdn ), and it should speed up the server's upload rate considerably.

@Simn
Copy link
Member

Simn commented May 11, 2013

It seems to run at normal speed for nme. NME 3.5.6 installed within about 20 seconds.

@waneck
Copy link
Member Author

waneck commented May 11, 2013

really? It almost took an hour here. And my internet connection isn't too bad (50mbps)

@back2dos
Copy link
Member

I can imagine that the haxe.org server is not highly prioritized in transatlantic internet traffic. So for all our non-european users CloudFlare is really worth consideration. However, if we do use CloudFlare, I think we need to set the cache headers right and we probably must forbid uploading the same version again, since it will be cached by the CDN - at least that's how I understand things.

@waneck
Copy link
Member Author

waneck commented May 13, 2013

Makes sense for me, back2dos! It should be as simple as setting a .htaccess configuration for it.

@MattTuttle
Copy link
Contributor

👍 NME takes a good 10 minutes for me in the central US. Most other libraries are not a problem since they usually fall under 1MB.

@back2dos
Copy link
Member

@waneck Can you take charge of this, even if only by mere delegation? ;)

@jasononeil
Copy link
Contributor

Sad to say I haven't done anything with either Cloudfront or AWS yet, but
I'm keen to learn and contribute to that if someone can point me in the
right direction (just a suggested strategy to follow and where to view the
various APIs would probably be enough).

On Wed, May 28, 2014 at 9:05 PM, Juraj Kirchheim
notifications@github.comwrote:

@waneck https://github.com/waneck Can you take charge of this, even if
only by mere delegation? ;)


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-44403382
.

@waneck
Copy link
Member Author

waneck commented May 28, 2014

I can handle it. But I'll need some help to get access to the Haxe.org DNS

@waneck
Copy link
Member Author

waneck commented May 28, 2014

Anyway, if you want to do it, the only thing you need is a cloudflare account, and repeat all our current DNS records into CF

@jasononeil
Copy link
Contributor

Ping @ncannasse (I assume?)

@ncannasse
Copy link
Member

@waneck reach me on Skype so we can setup it together

@MatiasArriola
Copy link

+1
I couldn't get installed any package today. Download speeds are really slow, and it ends up throwing Http connection timeout after a while. I tried using the -notimeout parameter, but I kept getting interrupted by the same timeout errors. Observed the same behavior from both linux and windows. This is reproducible only with big packages such as lime. Note that everything worked fine weeks ago using the same connection.
I'm located in Argentina, and looks like it happened to other people as well.
I guess for now the best workaround is to install everything from git.

@back2dos
Copy link
Member

back2dos commented Mar 9, 2015

What's the progress on this?

@waneck
Copy link
Member Author

waneck commented Mar 9, 2015

Oh sorry, I completely missed @ncannasse's post. I'll get in contact with him to set this up

@andyli
Copy link
Member

andyli commented Apr 8, 2015

Hey, I would also like to see a faster haxelib download soon.
Right now TravisCI builds a helloworld example in ~7 min, in which > 4 min is spent on haxelib install hxcpp. Interestingly, it takes only a few second to haxelib git hxcpp ....

@nadako
Copy link
Member

nadako commented Dec 22, 2015

Any progress?

@andyli
Copy link
Member

andyli commented Jul 15, 2016

I've just enabled AWS CloudFront for lib.haxe.org. Please report any problem regarding to haxelib install/submit/whatever.

I used CloudFront instead of CloudFlare because:

  1. CloudFront allows proxying to different origins based on URL. i.e. Currently the origin of http://lib.haxe.org/files/* is AWS S3 while the origin of all other request is AWS Elastic Beanstalk (EC2).

  2. CloudFlare does not allow proxying too much non-webpage content, which is our main use-case. According to its terms of use, "SECTION 10: LIMITATION ON NON-HTML CACHING":

    Using an account primarily as an online storage space, including the storage or caching of a disproportionate percentage of pictures, movies, audio files, or other non-HTML content, is prohibited.

@andyli andyli assigned andyli and unassigned waneck Jul 15, 2016
@andyli
Copy link
Member

andyli commented Aug 2, 2016

Sadly, CloudFront suddenly doesn't play well with our current haxelib clients, so I've disabled it. I don't think I've changed anything from our side that could cause the issue, so may be it is CloudFront.

The issue is, when haxelib install ufront-mvc using the haxelib bundled with haxe 3.2.1 or 3.1.3, it will error with Invalid string length. The reason is probably this: https://groups.google.com/forum/#!topic/haxelang/F2wRMafvVrI.
I checked that the issue goes away if we set http.noShutdown = true in the haxelib client. But we cannot really fix the haxelib clients that are already released... :(
It is funny that it happens only for some libs (e.g. ufront-mvc) but not others. Also, the haxelib client bundled with haxe dev is somehow not affected...

My plan is to fix the haxelib client to support http redirect (301/302), and then let our server to route the new clients to download libraries from a CloudFront-backed url. Old clients will still be directly served by the web server, which will be a bit slower, but at least works.

@buckle2000
Copy link

Downloading hx-cpp takes about 10 min in Hong Kong with manual download. CLI download is far worse.

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