4 ms·
Cloud Performance on a "Toy" Computer: From Python to Rust
- johnklos 2y ago"Toy"? Is a computer that can run a full fledged web browser these days really a "toy" computer? I'd guess the author hasn't been around long enough to remember real toy computers, like the V-Techs and other BASIC running computers for kids of the '80s. These days we have Arduinos, incredibly basic RISC-V, et cetera. It's not really impressive to run Rust on a modern computer just because it's not x86 and because it's a bit slower than a typical desktop or laptop. Self-hosting all software on an m68030? It's interesting that it's even possible. But Rust on a Raspberry Pi 4 happens all the time. Still, it's good to see a project move from Python 2 instead of just dying :)
- mmastrac 2y agoAuthor here: my first computer was actually TI-99, followed by a Coleco ADAM and a number of 8086/80286 systems that I used for a few years beyond their service dates because they were cast off from my dad's workplace. I put "toy" in quotes because it's pretty wild that you can effectively run a full-service, non-trivial site off 10W [¥] and ~$60 of hardware. I fully understand _why_ it's possible, but it still amazes me that this little board is doing what it would have took a 1U server in the 2000s. [¥] According to the Unifi PoE monitor, it's consuming 9.5W under this current HN load.
- nicce 2y ago> enough to remember real toy computers Definition of ”toy” changes with time. Don’t live in the past. Many other things we consider as toys were state of the art tech decades ago. What about physical Turing machine? Defenitely a toy these days. But ground breaking back then. Raspberry is defenitely a toy if you compare to real modern server hardware. Not to mention LLM processing power.
- satvikpendem 2y agoPhysical Turing machines cannot physically exist for we do not have infinite tape.
- fnordpiglet 2y agoSpeak for yourself my friend.
- fanf2 2y agoThey only need unbounded tape, which is fine, you can just run them a bit slower while your paperclip maximizer turns more of the solar system into tape.
- nicce 2y agoI prefer the Lego version: https://vimeo.com/44202270 https://vimeo.com/44202270 If we had the infinite blocks..
- fragmede 2y agojust tape the beginning of the tape to the end of the tape.
- littlestymaar 2y agoWith this line of reasoning there can be no virtual Turing machines either because we don't have infinite RAM, and no language is actually Turing complete because they can't run with infinite pointer size either …
- satvikpendem 2y agoCorrect.
- littlestymaar 2y agoTechnically correct, aka the least useful kind of correct.
- fnordpiglet 2y agoIt’s a toy compared to say a graviton host in aws or other server class machines. The comparison is temporally anchored in the present and isn’t meant to be a comparison to machines built for enthusiasts 40 years ago but to be an enthusiast computer in the present.
- deleted 2y ago[deleted]
- fragmede 2y agoIt was originally an education device aimed at children. Is that a, if not the definition of a toy? Sure, it's powerful, but that's just the march of technology and not a reflection on it's original aims.
- dang 2y agoCan you please edit out personally belittling assumptions from your posts to HN? It's easy to fall into, but nearly always wrong, and in any case it just adds sourness to the threads. Also, it would be good to review the site guidelines generally because you broke more than one of them here—for examople, "Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something." https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- bwjsjs 2y ago[flagged]
- doubloon 2y agoReally remarkable, congratulations.
- brigadier132 2y agoHow are you exposing the rpi to the internet?
- fragmede 2y agoCould just port forwards in your home's router and then front it by Cloudflare, or use Tailscale funnel if you want to get fancy.
- mmastrac 2y agoIt's a CloudFlare tunnel which saves a lot of infrastructure on my end. There's definitely some caching wins from using CF but a significant amount of traffic still ends up hitting upstream. I think maybe 25% of requests are cached and that includes the infinitely cached strongly-named resources.
- hamandcheese 2y agoFor this page in particular, which is now on the front page of HN, does any of the HN load reach the Pi? Or is it completely handled by Cloudflare? Search still does seem responsive, which I find impressive. Curious what the search load is right now.
- mmastrac 2y agoCPU is about 10% according to grafana and that seems to have been the peak. Search load is approx 1,000 per hour but there are spikes of a few dozen per second here and there, mostly from bots (there's an amazonbot?). That CPU spike appears to be correlated with the search spikes.
- floating-io 2y agoKudos on this one. Forget the "I'm running it on a Pi" angle, which is cool in its own right; the application itself is great, and just went on my surf list. Great work! Constructive comments: - Could use a visible "about this site" link, maybe pointing at that blog post or something similar. - Could use to make a link to the source site's comments page more visible instead of just "click on the logo". JMHO there. =)
- mmastrac 2y agoThanks for feedback. I'm always trying to figure out how to make it more useful and improve the UI/UX. Unfortunately not a designer so it takes a while to experiment. Always open to suggestions and constructive thoughts like the above. Appreciated.
- riquito 2y agoTry the website with Firefox mobile, is significantly cut on the left side. Also the viewport is fixed and you can't zoom on mobile. Nice blog post!
- mmastrac 2y agoOdd. I actually use FF mobile myself and it appears fine, but maybe it's my resolution? I do see that the layout of the metadata row on the homepage is a bit funky and the image in the post is cut off. I definitely need to clean that up. Would you be able to take a screenshot of what you're seeing? I'll add disabling of the fixed viewport to my TODO list. No real reason to disable it -- I think it was a leftover from the original mobile design from ~15 years ago.
- riquito 2y ago> Would you be able to take a screenshot of what you're seeing? https://i.postimg.cc/MK7PJwRk/Screenshot-20240608-165330.png https://i.postimg.cc/MK7PJwRk/Screenshot-20240608-165330.png (the link will expire in 7 days)
- ladyanita22 2y agoWhy choosing Rust?
- mmastrac 2y agoI had planned on running the site on a resource-constrained device like this Pi the entire time, and Rust is my currently-swapped-in language that I've been using for work for some time. I suspect that a GC language would be easier to get up and running but would probably have more unpredictable latency and memory spikes. It's also a labour of love, so there's a fun factor too.
- bomewish 2y agoOP: how many records are you storing and what’s the total size in gb? I can’t find this info on the site and am eager to get a sense of tantivy perf from a real life case.
- mmastrac 2y ago725,696 records according to the dashboard. These are sharded over 10 years, one shard per month which helps with write performance. If you'd like to boot the server to see what indexing looks like, you can find the latest raw data backup on GitHub and boot the server using the initialize command. https://github.com/progscrape/progscrape-data https://github.com/progscrape/progscrape-data If you can't get it working, feel free to send me an email.