Live data from Hacker News

Serving a high-performance blog solely from memory, using Rust

xeiaso.net

81–90 of 143 posts

Re: Serving a high-performance blog solely from memory, using Rust

#81

Earlier quoted context omitted.

> Even though your disk read is a memory read in all likelihood given how filesystem caching works, it's still an IO call, which isn't free. I wonder if io_uring could be used to issue a single syscall that would read data from disk (actually using page cache) and send it on the network. Of course, you could use DPDK or similar technologies to do the opposite - read the data from disk once and keep it in user-space b…

> I wonder if io_uring could be used to issue a single syscall that would read data from disk (actually using page cache) and send it on the network. Only if you don't care about HTTP/2 and TLS. And if you don't care about those, you can as well do sendfile() from a thread.

My site does serve itself out of a UNIX socket, so sendfile() may actually work. But most of the data is served with handler functions though.

Re: Serving a high-performance blog solely from memory, using Rust

#82

The tech is cool, but some of the language is so cringy. For example, the statement "websites are social constructs" makes zero sense. You could say that websites are material objects of a symbolic network of computer languages, like physical paper money is a material, fetishized object of the social construct of money. Websites themselves are not constructed socially. Maybe the author means how websites are perceive…

I don't have the time to get into a hardcore semiotics discussion at the moment, but basically I'm using words in the ways that normal people use words, which generally treats perception of the conventions of a thing as the thing itself. People do this mostly for convenience.

Re: Serving a high-performance blog solely from memory, using Rust

#83

Earlier quoted context omitted.

There is value in having unsafe parts of a program clearly annotated (not just with comments). It is similar to how in some languages you annotate pure functions and they do not compile unless they are pure.

be careful and do your research. anytime you need to implement anything that shares references (just about any data structure worth its weight in implementation time) you need to use Rc and friends. i am not talking about https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html . fine, this escape hatch is needed. i am referring to https://doc.rust-lang.org/book/ch15-06-reference-cycles.html .

Ah, I see now. That makes sense. I stand corrected.

Re: Serving a high-performance blog solely from memory, using Rust

#84

The tech is cool, but some of the language is so cringy. For example, the statement "websites are social constructs" makes zero sense. You could say that websites are material objects of a symbolic network of computer languages, like physical paper money is a material, fetishized object of the social construct of money. Websites themselves are not constructed socially. Maybe the author means how websites are perceive…

A website is a social construct because it can only function by the agreement of everyone involved (i.e., we all agree on how to parse HTML).

The individual site may be constructed individually (maybe) but it can only work if the society of people-who-use-the-internet all agree to follow a series of conventions about how websites work; you can't start using \ instead of \ and expect everything to work as normal, because the reason the \ tag is used to define the body of a page is because we needed a way to make sure people can use a webpage without having to define an entire new language for each one.

Re: Serving a high-performance blog solely from memory, using Rust

#85

Earlier quoted context omitted.

> The speed of light is only so fast. Is the Internet not connected internationally (US -> Europe for example) via cables underneath the ocean? Speed of light would be satellite, light? Not electric current? Or is electricity flowing through a wire also "speed of light"?

Nothing is faster than speed of light. In fact signals transmitted via copper wires are traveling at 2/3 the speed of light. Don't know the details about fiber ocean links, but it certainly won't be faster than speed of light.

Fiber optics are also about 2/3rds the speed of light. One of the interesting things about Starlink is that when they have laser links between satellites they should be able to beat terrestrial latencies over very long distances like California to London.

Re: Serving a high-performance blog solely from memory, using Rust

#86

After going to the end of a long post, I'm disappointed to not find any latency or throughput efficiency metrics. Author seems to claim he has a very popular high-traffic blog and it is super fast, faster than all the popular web servers serving static pages. Where's the performance data to prove this? edit: web.dev measure gave this blog post url a performance score of 30/100 which is quite poor.

Author isn't a man (https://github.com/Xe)

Re: Serving a high-performance blog solely from memory, using Rust

#87
I get the fun for a developer to set up something like this to experiment and learn new things. But I'm left with a question: why? Like, is there really a point aside for the aforementioned intrinsic dev fun?

There has to be a point of diminishing return. And again, I'm not discarding the dev side of things but it seems a lot of extra tooling and complexity cor not much gain.

Re: Serving a high-performance blog solely from memory, using Rust

#88
post #60

Earlier quoted context omitted.

That “traditional” site doesn’t actually load the data from disk, in practice. It does once, after a reboot, but that’s true for this solution’s executable file as well. Does Apache/Nginx/IIS load static files in memory ahead of time? I would assume no, unless someone went through and did some optimizations. Even so, there is always a point where memory runs out, and in that case a templating engine is essentially co…

Author here. I don't identify as male. It would be nice if you could update your comment to not make a factual error when referring to me. Please use https://pronoun.is/they . Thanks!

No post body was provided.

Re: Serving a high-performance blog solely from memory, using Rust

#89

Earlier quoted context omitted.

> The speed of light is only so fast. Is the Internet not connected internationally (US -> Europe for example) via cables underneath the ocean? Speed of light would be satellite, light? Not electric current? Or is electricity flowing through a wire also "speed of light"?

First of all, the "speed of light" is usually referring to c , the maximum speed that matter or energy can move at. Second of all, electrical signals in cables move at speeds slightly lower than c, but very close to it, so the speed of light is still a very good approximation of the possible upper bound. Third of all, intercontinental cables are normally fiber optic, for several reasons. That is, they directly transm…

We tend to think of wires as a garden hose for electrons, but it's the EM field that propagates, moreso than the electrons. Especially for AC power and for signals.

Re: Serving a high-performance blog solely from memory, using Rust

#90
post #86

After going to the end of a long post, I'm disappointed to not find any latency or throughput efficiency metrics. Author seems to claim he has a very popular high-traffic blog and it is super fast, faster than all the popular web servers serving static pages. Where's the performance data to prove this? edit: web.dev measure gave this blog post url a performance score of 30/100 which is quite poor.

Author isn't a man ( https://github.com/Xe )

> Nephelemancer, Kastermakfa, Hacker, Ordained Minister [...] Please call me (order of preference): Xe/xer, They/them or She/her please.
Post reply on HN