News for hackers. Stuff that matters.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by eatonphil on Wednesday June 30, 2021 @07:41AM (#27687325)
From personal experience, any cheap vps that can serve static pages will stand the front of HN.

The blogs that go down here typically back every request by MySQL (ahem, WordPress) which is totally unnecessary and often actively harmful since MySQL has very low default total connections allowed.

The point being: don't serve requests backed by a database unless the results are likely to change very dynamically!

Re:A foreign seller has hijacked my Amazon Klein bottle listing by toast0 on Wednesday June 30, 2021 @01:23PM (#27691129)
> The blogs that go down here typically back every request by MySQL (ahem, WordPress) which is totally unnecessary and often actively harmful since MySQL has very low default total connections allowed.

WordPress is not my favorite thing and some of the available plug-ins do terrible things with MySQL, but the problem is not too low default connections; it's too many PHP workers. WordPress is generally focused enough that most of the wall time is spent in waiting for the database, so you want to optimize for throughput; one or two workers per cpu thread is plenty for that. More concurrency than execution available reduces throughput, so it's better to queue requests in your http layer than to process multiple at once.

Large numbers of MySQL connections are more appropriate when the web pages do a mix of things, but more/mostly idle DB wise; in that case, you might still want persistent connections to reduce round trips before a query, but are less likely to have a query backlog large enough where task switching overhead becomes significant.

Re:A foreign seller has hijacked my Amazon Klein bottle listing by eatonphil on Wednesday June 30, 2021 @01:27PM (#27691184)
That makes sense, thanks for clarifying.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by billpg on Wednesday June 30, 2021 @07:53AM (#27687398)
If you'll excuse me, I'm going to be looking at HTML cache add-ons for my WordPress site.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by eatonphil on Wednesday June 30, 2021 @08:10AM (#27687509)
Yes you can do that or there are static site generators backed by MySQL too. So your data and configuration site can still be dynamic but your served site will be completely static.

The only difference between this and adding a cache is that the cache is another piece of software in your production stack.

Re:A foreign seller has hijacked my Amazon Klein bottle listing by Axien on Wednesday June 30, 2021 @09:07AM (#27688012)
Can you recommend a good static site generator?
Re:A foreign seller has hijacked my Amazon Klein bottle listing by eatonphil on Wednesday June 30, 2021 @09:10AM (#27688040)
For WordPress? No. I don't use it. I just know SSGs for it exists and not enough people/companies use it (when they're using WP in the first place). :)

Vanilla SSGs are so simple I ended up writing a basic one out of a markdown and jinja parser in Python every time (for example: https://github.com/eatonphil/notes.eatonphil.com/blob/master...).

If I were not lazy I might learn one of the major ones like Hugo.

It doesn't matter what SSG you pick, they all produce the exact same kind of thing.

Re:A foreign seller has hijacked my Amazon Klein bottle listing by beermonster on Wednesday June 30, 2021 @02:20PM (#27691841)
When my friends webserver died and they had no backups, I found the wayback machine was s good (historic) static site generator ;-) Just mirror it from there and voila.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by cyberge99 on Wednesday June 30, 2021 @03:20PM (#27692460)
Hexo is a good and fast lightweight generator.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by beermonster on Wednesday June 30, 2021 @02:19PM (#27691828)
No need to even get a cheap VPS. You can just serve up static content in an S3 bucket or similar.
Re:A foreign seller has hijacked my Amazon Klein bottle listing by eatonphil on Wednesday June 30, 2021 @02:23PM (#27691877)
For sure. I've used Github Pages (free site hosting) for a few years now. I'm leaning back toward VPS though so that I can do access log analysis rather than depend on Google Analytics.

But the point was to make a comparison to a Raspberry Pi and emphasize that you do not special compute to withstand thousands of page views. Even S3 and GH Pages are overkill in terms of the compute behind both of them vs. what you need minimally.