Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
I just figured any savings where savings can be made is a good thing, especially if there are zero downsides, plus it means very low CPU usage as it's literally just pulling from RAM without any CPU usage. It also precaches gzipped and brotli'd versions of sensible files so that it can accept-encoding for a variety of browsers.
Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
31–40 of 119 posts
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#32Earlier quoted context omitted.
When was this added? I recall several years ago having to do this with edge lambdas. IE the it would happily resolve / to /index.html would be fine, but if you wanted to do /my-dir and have it resolve to /my-dir/index.html it would 404.
Now that I'm curious because I remember facing no such issues. Cloudfront was my way of testing all of these scenarios to see what happens when the URL endpoint changes, etc. and then move to Akamai to scale up. Did some quick searches and I think there seems to be some kinks indeed and of course the solutions. Here are a few; - https://stackoverflow.com/questions/59634922/how-do-i-serve-... - https://aws.amazon.com/…
Here's the request edge lambda:
https://github.com/radiosilence/cdk-static-web/blob/master/s...
Here's the response edge lambda:
https://github.com/radiosilence/cdk-static-web/blob/master/s...
It's been a while since I've updated that project though.
With nano-web for my current site (https://blit.cc) I am just spinning up a free-tier unikernel instance on EC2 and using it as the CF origin. Possibly even more cost effective than S3, and far simpler.
Response times for the "waiting" portion are usually around 5-10ms with CF and if I am going direct to the origin it's around 2-5ms
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#33Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
(It's negated by the SSL handshake, but that's another discussion...)
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#34Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
Latency between me and my cloud provider is about 10x lower than the latency of Python's http.server on localhost. (It's negated by the SSL handshake, but that's another discussion...)
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#35h2o ( https://h2o.examp1e.net/index.html ) is a full-fledged, single-binary, open source web server. Check it out.
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#36Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
Some things we might have 1000+ checkboxs to work through on a checklist (cut down by some initial tailoring steps). Even things with a small wait on a click etc are frustrating. If you can drive using a keyboard shortcut and get very immediate response you can really move through things.
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#37Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
I just figured any savings where savings can be made is a good thing, especially if there are zero downsides, plus it means very low CPU usage as it's literally just pulling from RAM without any CPU usage. It also precaches gzipped and brotli'd versions of sensible files so that it can accept-encoding for a variety of browsers.
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#38Considering the latency between the user web browser and the server, does the “extremely low latency on account of caching all files in memory” really matter? The files should already be cached by the OS and using sendfile lets the OS copy the file directly to the network.
Latency between me and my cloud provider is about 10x lower than the latency of Python's http.server on localhost. (It's negated by the SSL handshake, but that's another discussion...)
I ask because those numbers seem really off.
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#39Earlier quoted context omitted.
How has your experience with Nanos unikernel been so far since you started? Have you noticed any benefits over Docker?
I mean, I think it's an interesting approach to and kind of nice to be going back to more PaaS primitives. I haven't used it in production, it does seem extremely quick and kind of simple and nice. Either way, I figure the more projects that support it natively, the bigger the ecosystem grows and the more data we'll see based on real world usage. The tooling seems pretty good, though the documentation could do with s…
I like your approach towards this, I'm thinking the same. I appreciate the response you provided, I've been planning on playing around with it for a while when I get the time. Your comment made me even more interested.
It went quite quick from seeing your comment on the post about Nanos to your own project integrating it!
Re: Show HN: Nano-web – a low latency one binary webserver designed for serving SPAs
#40oof, as someone who frequently has to run DAST tools, returning a 200 for something that should be a 404 is the bane of my existence.
The tool will try to request sensitive files by trying something as simple as fetching hxxps://example.com/../../../etc/passwd. If you return a "200 OK", it will flag as a security issue, even if the resulting data isn't a passwd file.
I don't think you can convince me that returning a 200 OK and some default content for a URL that doesn't exist is ever the correct thing to do. If you want to use 301 or 302 to redirect them to the front page, that's probably fine, but the most correct thing to do is 404.