[HN Gopher] Cloud Performance on a "Toy" Computer: From Python t...
___________________________________________________________________
Cloud Performance on a "Toy" Computer: From Python to Rust
Author : mmastrac
Score : 70 points
Date : 2024-06-05 20:09 UTC (3 days ago)
(HTM) web link (progscrape.com)
(TXT) w3m dump (progscrape.com)
| johnklos wrote:
| "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 wrote:
| 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 [Y=]
| 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.
|
| [Y=] According to the Unifi PoE monitor, it's consuming 9.5W
| under this current HN load.
| nicce wrote:
| > 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 wrote:
| Physical Turing machines cannot physically exist for we do
| not have infinite tape.
| fnordpiglet wrote:
| Speak for yourself my friend.
| fanf2 wrote:
| 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.
| nicce wrote:
| I prefer the Lego version: https://vimeo.com/44202270
|
| If we had the infinite blocks..
| fragmede wrote:
| just tape the beginning of the tape to the end of the tape.
| littlestymaar wrote:
| 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 ...
| satvikpendem wrote:
| Correct.
| littlestymaar wrote:
| Technically correct, aka the least useful kind of
| correct.
| satvikpendem wrote:
| I'm not sure that's how that phrase goes...
| fnordpiglet wrote:
| 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.
| fragmede wrote:
| 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.
| doubloon wrote:
| Really remarkable, congratulations.
| brigadier132 wrote:
| How are you exposing the rpi to the internet?
| fragmede wrote:
| 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.
| mmastrac wrote:
| 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.
| hamandcheese wrote:
| 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.
| mmastrac wrote:
| 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.
| floating-io wrote:
| 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. =)
| mmastrac wrote:
| 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.
| riquito wrote:
| 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!
| mmastrac wrote:
| 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.
| floating-io wrote:
| Your designs are better than mine! I can figure out what
| buttons should be where, but the aesthetics escape me... :)
| ladyanita22 wrote:
| Why choosing Rust?
| mmastrac wrote:
| 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.
| bomewish wrote:
| 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.
___________________________________________________________________
(page generated 2024-06-08 23:01 UTC)