7 ms·
Jekyll blog on Amazon S3 and CloudFront
- ceworthington 14y agoOptimizing is often an after-thought on side projects, so it's cool to see you take a stab at it for your personal blog.
- tobiassjosten 14y agoGlad you like it! Definitely nice when you get to take the time with these kind of projects.
- tikhonj 14y agoI wonder what the costs are like. Just looking at the S3 page, it seems this would actually be rather cheap, which makes it an attractive option (especially for a student like me :P). However, I'm not entirely certain on how much resources a small blog like this would use, so I don't know exactly how expensive it would be.
- Jach 14y agoI run my blog off an EC2 Micro instance running Apache, which Amazon conveniently offers a free year of service for. (And it's not expensive paying for it yourself either ($69/yr for a Small). I used to use HostGator, AWS is much nicer--apart from outgoing emails, but once you're set up you're good.) Pingdom is kind of nifty for its comparisons. I got the author's site to be only in the top 97% by running the benchmark again. My own site varies from being in the top 90% to 96% (I did get a 99% once), the only real "optimization" I do is reading cached pages from "disk" (EBS is notoriously pretty slow). I could probably shave off an average 100ms with some really simple tricks. Under heavy load I'm certain I'd fall over on such a puny machine that isn't even using nginx+memcached.
- rwos 14y agoHonestly I don't think pingdom's "faster than x %" message is all that helpful. My homepage is "faster than 100% of all tested websites" (from Amsterdam at least). Since my site is one of the tested websites (after all it was tested right now), does that mean it's faster than itself - or what? ;-) For this kind of page-load masturbation, I prefer http://gtmetrix.com http://gtmetrix.com - especially the side-to-side comparison is pretty nifty.
- spindritf 14y ago> Pingdom is kind of nifty for its comparisons. I got the author's site to be only in the top 97% by running the benchmark again. My own site varies from being in the top 90% to 96% (I did get a 99% once) If you strive for geek cred, you can get > Your website is faster than 100% of all tested websites The trick is to 1. have a static website, obviously, and everything inlined (so basically a single index.html); 2. run the test twice — dns responses should cache during the first one; 3. host your website in Amsterdam which is where they have (at least one of) their testers: > Tested from Amsterdam, Netherlands on October 16 at 19:04:21 Oh, and don't use SSL.
- pjungwir 14y agoAccording to the pricing page [1], a reserved Small is $69/yr plus $0.039 for any hour the instance is running, which could add up to another $341 for the year. [1] http://aws.amazon.com/ec2/pricing/ http://aws.amazon.com/ec2/pricing/
- Jach 14y agoGood catch, I just quickly glanced at the figure without remembering the hourly rates still apply. Going with the yearly-reserved Micro you're at $128 for the year, which is a bit more than many shared hosts but at least you have absolute power over the software.
- bad_user 14y agoJust for a Jekyll blog, you could just host it on a free Heroku instance with an Nginx server and put CloudFlare in front of it. In a free Heroku instance you have a lot of juice actually, especially for an Nginx server, the only problem being that the instance will go in idle mode after an hour of inactivity and so unlucky visitors can get some latency on the first request, although it's not that awful. On the other hand CloudFlare is a pretty good proxy that works like a CDN, so with the right caching headers set, CloudFlare will serve many requests from its own cache.
- michaelt 14y agoI do this for my little personal website. The key downside to hosting directly on S3 is it only does static pages. So it'll be manual HTML or a static-html-generating-tool like Octopress - none of this fancy dynamic content. If you're happy with this constraint, hosting on S3 works pretty well for me.
- tikhonj 14y agoI'm actually very happy with that constraint: I think something statically generated would be perfect for my goals and much simpler to use, understand and customize than something like Wordpress. The only thing to miss would be comments, but I was planning to use something like Diqus for that anyhow. (I will start a blog, one of these days :P.) Also, almost anything would be an improvement over my current setup which is using PHP on Apache to do what a static compiler would do much better. All I really want is a way to factor my website and reduce code duplication. Good to hear it's working well for you.
- pessimism 14y agoThis is what a bill for my blog with some hundreds or few thousands of hits looks like: http://pygm.us/s6mFV+OP http://pygm.us/s6mFV+OP. This is solely S3. Aside from being unable to figure out a anti-hotlink bucket policy, S3 is great and basically free in most for most blogs. The blog: http://pygm.us/q6Nv3lja http://pygm.us/q6Nv3lja.
- tikhonj 14y agoWow, that's awesome. Of course it's still literally infinitely larger than my current income :P. (I'm abusing the word "infinitely" horribly, but so be it.) I think I'm almost definitely going to go the S3 route when I get around to redoing my site and starting a blog. (One day...)
- tobiassjosten 14y agoCheck out Amazon's pricing pages ([1] and [2]) for details. As for resources spent, my own blog has had just over 10k pageviews since Saturday when I launched on S3/CF and for that I'm paying $0.07 (S3) + $0.12 (CF) = a whooping $0.19! Including a lot of writing files back and forth to get everything up and running. [1] http://aws.amazon.com/s3/pricing/ http://aws.amazon.com/s3/pricing/ [2] http://aws.amazon.com/cloudfront/pricing/ http://aws.amazon.com/cloudfront/pricing/
- engtech 14y agoIf wordpress.com can exist offering to host people's blogs, I think someone could create a site that does these techniques in the backend and provides a nice content management front end.
- tobiassjosten 14y agoYou could probably just slap CloudFront on the existing WP site. Might have side-effects but it would surely bump the performance up.
- jh3 14y agoI just noticed your domain is vvv.tobiassjosten.net.
- tobiassjosten 14y agoYup! I explain why in my first post: http://vvv.tobiassjosten.net/internet/using-www-for-your-domain/ http://vvv.tobiassjosten.net/internet/using-www-for-your-dom...
- bad_user 14y agoI also use Jekyll for my own blog [1]. However, because I really love naked domains (easier to dictate over the phone, shorter), I cannot do CNAMEs so I am hosting my blog on a free Heroku instance. My initial Heroku config evolved too. I am now serving my pages through an Nginx server, installed with a custom buildpack [2] that I forked and modified a little to suit my directory structure (I could also make it compile the site on deploy but was too lazy for that). I am also putting CloudFlare in front of it. Basically an article can end up on Hacker News, Reddit, Slashdot and the traffic combined will probably not make it even blink, while the hosting costs are zero. Whenever I see people bitch about Wordpress woes, setups of clusters, security issues, or about caching/editing/versioning/archiving plugins or about costly add-ons and restrictions, it makes me chuckle a little - but then again, this setup is not for mere mortals or optimal for large content websites - for technical people however is a freaking nirvana. [1] http://bionicspirit.com http://bionicspirit.com [2] https://github.com/alexandru/heroku-buildpack-nginx https://github.com/alexandru/heroku-buildpack-nginx
- jvoorhis 14y agoWith AppFog [1], you can get WordPress with the tantan-s3 plugin pre-installed for uploads so you can share nothing (but the database) and scale with a click. You also get Varnish caching with no additional work. Full disclosure: I am an engineer at AppFog. [1] https://appfog.com/ https://appfog.com/
- bad_user 14y agoI'm sure your service is useful, however allowed-plugins and other restrictions is something I like to avoid, not to mention that 1-click scaling is 1-click too many. Wordpress is only useful if you want to publish in multiple categories with articles created by other (non-technical) people, need designs made by other designers - basically for a publishing factory or for people that don't want the hassle of learning to use Git, Jekyll and a good text editor. However Jekyll/Git/Heroku is simplicity in its purest form, especially for developers and with simplicity comes a lot of power ... like I've had 2 blogs before this one and I lost the content on both out of ignorance, by stopping payments to my hosting provider, then later regretted it. My content right now is on my laptop, mirrored by both GitHub and Heroku and you get for free the history of all changes, while the articles themselves get edited in the most powerful text-editor ever created (Emacs). Scaling comes for free. Costs are zero. The domain is mine. I can publish however many ads I want (coughwordpress.comcought). It wouldn't lock me out if I were under 18 (coughblogger.comcough). To me that's just awesome. On the other hand it's just a stupid blog. Which it should be. Which is why less is more.
- smarx 14y agoFor those of you who would prefer to just save your blog (or other static website) in Dropbox instead of uploading to S3, my startup just left beta today: http://www.site44.com http://www.site44.com (Sorry for the shameless self-promotion; it's an exciting day for us!)
- andrewcooke 14y agoi think the 1% may not very accurate? my blog is also rated as being in the top 1% and it doesn't use cloudfront or s3 or anything cool like that. it's just static pages at webfaction (who are nice guys, but still, it's a shared host). not trying to diss the post, which was very interesting, just suspect of the pingdom stats. unless using static pages alone is sufficient to get you into the fastest 1% these days? i guess it's possible. maybe they're hosted nearby... [update: the traceroutes differ in where they enter the usa]
- jvoorhis 14y agoNearby Pingdom? It's always possible that you're in the same data center. In theory, CloudFront pages are always hosted nearby.
- koenbok 14y agoMy side project Cactus is a simpler alternative to Jekyll and has s3 deployments built in: https://github.com/koenbok/Cactus https://github.com/koenbok/Cactus
- tobiassjosten 14y agoThe rate at which these generators pop up is a testament to how awesome they are. I really think you're on to something with the built-in S3 deployment. Any plans for extending it with CloudFront caching?
- minhajuddin 14y agoFor developers who want a simple blogging engine. Try http://substancehq.com http://substancehq.com . All your blog's content will be served via varnishd which is an awesome cache.
- tobiassjosten 14y agoVarnish would have been fun to play with for a static blog. For one thing you then could use ESI to not have to invalidate the cache as often. But I disagree with one thing — the "git push → deploy dance" is a pro for Jekyll! ;)
- minhajuddin 14y agoI have found it to be fun the first few times, but as your blog grows I've found it to be a pain to deploy every time I make a small correction. Also, with markdown there are always corrections to be made for formatting purposes.
- wiredfool 14y agoI was watching a demo of Jekyll and Octopress pushed to github at a user group meeting. As a demo, the presenter made the requisite small change, committed, and pushed. 5 MB of upload later on a clogged wifi link, it was up live. Admittedly, that's because the generation was done on his laptop and pushed up, not done on the server side. But 5mb and a ton of rendering time is going to suck if you're ever changing things for formatting, or edit anything.
- mise 14y agoEven clicking through to the link, it loaded faster than I could Alt-Tab to the next window.
- tomjakubowski 14y agoOne very nice side-effect of hosting on GitHub is that it integrates very nicely with your repository GitHub pages. URLs for your repos are simply http://domain/reponame http://domain/reponame. For example (apologies for the self-promotion): * my website, hosted on GitHub: http://crystae.net/ http://crystae.net/ * toy cellular automata project, hosted on GitHub: http://crystae.net/automatra http://crystae.net/automatra Author's argument about Github Pages not allowing custom Jekyll plugins is true, but you can always build the site locally with whatever plugins you like and deploy the built copy (see Octopress[1] for a popular example of this). 1: http://octopress.org/ http://octopress.org/
- tobiassjosten 14y agoThat's definitely an option and to be fair I didn't use any Jekyll plugins up until recently. But my main gripe is still the lacking redirection. I can't lose that ability for this blog and all its accumulated URL fixes over the years. For new blogs I could definitely consider GitHub Pages. In fact I use it for one I started just a month ago.
- fjw 14y agoThere actually is a way to redirect requests on GitHub Pages. It's a bit hacky, but if you want to stick with GitHub's hosting, it might be worth doing. You can manually create a new page "index.html" in the corresponding subdirectory for your redirect. If you want /post/oops-i-made-a-tpyo to redirect to your updated oops-i-made-a-typo link, you would create /post/oops-i-made-a-tpyo/index.html and make an HTML redirect: <meta http-equiv="refresh" content="0;url=/post/oops-i-made-a-typo/" /> You can see this at work on my blog [1] and the code for the redirects I made [2] when migrating from Tumblr. [1] http://frankjwu.com/ http://frankjwu.com/ [2] https://github.com/frankjwu/frankjwu.github.com/tree/master/post https://github.com/frankjwu/frankjwu.github.com/tree/master/...
- gwern 14y agoI switched my Hakyll site from NFSN to Amazon S3 back in June. My basic observations here would be: 1. I don't see why you would bother with Amazon's CloudFront. CloudFlare is as easy to use and free, unlike CloudFront; it's worked well for me. 2. s3cmd is a good utility, but there are occasional cornercases. On my Debian testing system, use of '--guess-mime-type --mime-type=text/html' may have... unfortunate consequences for quite a few files you would not expect, such as CSS or image files.
- rsync 14y agoJust to clarify, are you saying in your blog post that you can't point a bare domain to your cloudfront endpoint, and that you have to use something like wwwizer to use a bare domain with your cloudfront setup ?
- mattdeboard 14y agoNo, you can specify multiple CNAME values for a single CloudFront distribution; afaik nothing stopping you from configuring 'foo.example.com', 'bar.example.com' and 'example.com' to all point to 'randomletters.cloudfront.net'
- bad_user 14y agoYou cannot point naked domains (like example.com) to CloudFront, because naked domains can only be configured with A records, not with CNAMEs.
- deleted 14y ago[deleted]
- mattdeboard 14y agoI see, thanks.
- mafro 14y agoFor anyone wondering why you might not want to use GH pages, and use S3/Cloudfront instead... The Git 1.8 release notes ended up with this today: "You're over the rate limit. Serve this file from your own servers. Contact support@github.com if you have questions." https://raw.github.com/git/git/master/Documentation/RelNotes/1.8.0.txt https://raw.github.com/git/git/master/Documentation/RelNotes...