Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cloud Performance on a "Toy" Computer: From Python to Rust (progscrape.com)
79 points by mmastrac on June 8, 2024 | hide | past | favorite | 33 comments


Kudos 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. =)


Thanks 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.


Try 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!


Odd. 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.


> Would you be able to take a screenshot of what you're seeing?

https://i.postimg.cc/MK7PJwRk/Screenshot-20240608-165330.png

(the link will expire in 7 days)


Thanks! No idea what happened here but it's prob a css breakpoint glitch. I'll try to repro.


Your designs are better than mine! I can figure out what buttons should be where, but the aesthetics escape me... :)


How are you exposing the rpi to the internet?


It'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.


For 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.


CPU 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.


Could just port forwards in your home's router and then front it by Cloudflare, or use Tailscale funnel if you want to get fancy.


OP: 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.


725,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

If you can't get it working, feel free to send me an email.


Really remarkable, congratulations.


Why choosing Rust?


I 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.


"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 :)


Author 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.


> 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.


Physical Turing machines cannot physically exist for we do not have infinite tape.


They 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.


With 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 …


Correct.


Technically correct, aka the least useful kind of correct.


I'm not sure that's how that phrase goes...


By that definition, no computer is Turing-complete either.


I prefer the Lego version: https://vimeo.com/44202270

If we had the infinite blocks..


Speak for yourself my friend.


just tape the beginning of the tape to the end of the tape.


It 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.


It’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.


Can 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




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

Search: