Hacker News new | past | comments | ask | show | jobs | submit login

The site is currently reporting an "Error establishing a database connection." If at all possible, please try to make simple content sites like this static using a tool like Netlify or http://stout.is. Static sites are faster, more reliable and cheaper to operate.



I got so annoyed with the complexity and poor performance of web frameworks that I sat down for a day last year and made my own little database-less CMS for this kind of usecase. It's not quite as fast as a purely static solution, but I think it would be fast enough for HN:

https://github.com/muellermichel/guetzli


Agreed.

Google Cache for those who want it:

http://webcache.googleusercontent.com/search?q=cache:EHdeB5i...



Knowing nothing about web hosting - could a static site hosted on a basic hosting plan survive a hacker news front page? Or what would be required?


It'd depend on the shared hosting provider and your site.

Having hundreds of MB of content that people are going to want to load, even if it's all served statically, will probably still have you in a bad way with the cheapest of hosting providers.

But it'll have a much better chance of surviving than someone running wordpress or something that's got zero caching and needs to do a ton of calls to a shared MySQL host.


Right sure, I was just picturing a static HTML page measured in KB.


Then yes, it would probably be fine, within reason.

When running a static site at very high traffic loads it becomes about how many connections the webserver can handle and how much bandwidth you have to serve the site itself, rather than pure power of the server to process all the requests a dynamic site would generate.

You can start to chew through bandwidth allocations pretty quickly when you get a couple thousand concurrent visitors, so a shared hosting plan might run out pretty quickly if the cap is small, even with a fairly small site. And something like Apache would need tweaking a fair bit to handle that number of connections without eating all the RAM. Nginx is better in that regard and could pretty easily handle thousands of concurrents.

So a small DigitalOcean VPS can easily handle millions of 'hits' per day if set up with a little care, and more than that if setup well, but you just have to watch you don't saturate the connection.

I mirrored a few sites that had faced the reddit hug of death (just to see what the load was like) and I found you can easily hit 200mbps* sustained connection requirement with all the visitors it brings just from the comment thread, which people don't enter as much as the list posting.

*(depending on the size of the page obviously, the bigger the page the more mbps it'll need to serve, average was around 20-50mbps).


A VPS is quite a bit different than regular shared hosting though.

Like the absurdly low single-digit-per-month hosting plans with 'Unlimited' everything. They're run to push the most customers onto the fewest boxes possible, and offer incredibly large feature sets.

So, while you might be tuning your static content to be as small as possible, you're probably on a box that's serving a heck of a lot poorly optimised sites. Disk IO is probably going to be an issue if you can't keep your content in memory (remembering that memory pressure is probably pretty high)


Ah, you're right, disk IO is one I hadn't considered too. I"m so used to availability of cheap VPS and SSD I'm not sure the last time I used actual shared hosting myself.

Those sorts of shared hosting plans have a funny way of disabling your site if you get a big surge of traffic, despite the 'unlimited' claims.

I was told once, "Yes, your plan is unlimited, but not infinite.' when I had a post on a long forgotten site go mildly popular.

I suppose on those types of machines the sheer number of connections would get you in hot water too, especially if they're running vanilla apache and it starts burning through memory there.


Thanks for the info!


If it's static, which is really recommended for content like this, I'd opt for Netlify (we love it for our projects) or a comparable service. A traditional shared host will likely run into trouble once you reach a significant traffic spike, which is exactly the moment when you absolutely don't want to experience an outage. Netlify, even on their cheapest 10 bucks/month plan, will let you use their CDN network and offer performance that is far ahead of shared hosts, let alone database backed websites.


Why not use (free) cloud-flare for static websites?


Cloudflare stands between a website and a user; you still need somewhere to host it.


amazon s3 buckets are a perfectly valid way to host static websites.


You could host it for free on GitLab or GitHub with CloudFlare's free CDN - should hold up to almost anything.


That's what I do, with GitLab. I chose GitLab because it allows you to use true/full https with custom domains thanks to letting you upload your own certificates.

I know you can get what looks like https with Cloudflare, custom domain and GitHub but it's not full end-to-end.

GitLab also has built in CI (rather than something external like Travis with GitHub) so you can simply push a commit and have a free 'runner' (really a Digital Ocean instance) spin up, run a build script then deploy to GitLab Pages, all for free. It's pretty amazing what you can do there to be honest.

I'm using it with Hugo but there are 'runners' for just about any SSG. I think many people have switched to using it for the ability to use Jekyll plugins unlike over at GitHub.

From the connection times I'm guessing the the servers are somewhere on the East Coast of the US (maybe they're still on Azure?) so I can hit sub second loads in Europe, the US and just about get under 1.5 secs in Australia/Asia.

It's impressive for the grand old price of 'free'!


Yes, easily.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: