HNHacker News
TopNewBestAskShowJobs

dorianniemiec

464 karma · joined May 2, 2024

Author of Ferron - a fast, modern web server built for production debugging. An #ActuallyAutistic person.

https://dorianniemiecsvrjs.github.io/

submissionscomments
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
But Ferron isn't a state management library for front-end frameworks, it's a web server!
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Ah... I also saw one more person confused about the title...

By the way the rewrite is still in Rust.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Ferron uses a different library for TLS - Rustls.

You can read how Rustls compares to other TLS implementations, when it comes to implementation vulnerabilities, from the Rustls manual: https://docs.rs/rustls/latest/rustls/manual/_01_impl_vulnera...

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
> If you just need some www server quickly pointing your domain to some other dude domain is not the way to go.

Yeah. But as I said before, people installing Ferron on their servers don't need to use this demo. Oh, and people using this demo don't need to install Ferron on their servers.

I just added two notices to this demo:

> Note: After completing the demo, it's recommended to delete the subdomain you have just created to prevent security issues.

> This demo setup is optional and exists only to demonstrate automatic TLS functionality. You do not need to point any subdomain to demo servers for normal use of Ferron.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you!
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you! :)

Wishing the best for your concept too!

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you! You can contribute to https://github.com/ferronweb/ferron, if you want to.
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
No problem! I'm rewriting the codebase of Ferron (the rewrite is still in Rust), to follow some suggestions people made for the web server (faster async runtime, different configuration format). The original codebase would have been bit hard to work on to follow these suggestions...
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you!

> Did you benchmark against other Go web servers like Caddy or fasthttp?

I have already benchmarked Ferron against Caddy! :)

> so I’d love to hear more about how your server handles concurrency or large responses.

Under the hood, Ferron uses Monoio asynchronous runtime.

From Monoio's GitHub repository (https://github.com/bytedance/monoio):

> Moreover, Monoio is designed with a thread-per-core model in mind. Users do not need to worry about tasks being Send or Sync, as thread local storage can be used safely. In other words, the data does not escape the thread on await points, unlike on work-stealing runtimes such as Tokio. > For example, if we were to write a load balancer like NGINX, we would write it in a thread-per-core way. The thread local data does not need to be shared between threads, so the Sync and Send do not need to be implemented in the first place.

Ferron uses an event-driven concurrency model (provided by Monoio), with multiple threads being spread across CPU cores.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Oh, nice to meet you!

> TLS (HTTPS) can be easily enabled by default, but it requires certificates. This requires a learning curve for the application developer but can be automated away from the user.

Yeah, these certificates can be obtained from Let's Encrypt automatically.

> Everything executes faster when WebSockets are preferred over HTTP. An HTTP server is not required to run a WebSocket server allowing them to run in parallel. If the server is listening for the WebSocket handshake message and determines the connection to instead be HTTP it can allow both WebSocket and HTTP support from the same port.

Oh, seems like an interesting observation!

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you! Excited to see what will you serve with Ferron.
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you! Yes, graceful restarts in Ferron are supported on Linux, Unix, and alike. You just need to send a SIGHUP signal to Ferron process, or simply do "systemctl reload ferron" or "/etc/init.d/ferron reload" as root.
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
> It's OP that's trying to "optimize the web server for reverse proxying and static file serving", when what we have out there is more than enough.

I have optimized it, so it would be faster than the original server I have been working on.

> (...) give some warning like this might be interesting to you but it's not solving any real pain point. Keep that in mind when deciding if work on this will be worthwhile.

If you feel the project isn't solving a real pain point for you, you don't have to use it! I was showcasing my web server to interested people on Hacker News.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Oh, thank you for bringing me up the blog post about simplicity, that was an interesting read!
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you for the feedback!

I did the reverse proxy benchmarks for NGINX, when someone opened a GitHub issue about missing NGINX benchmarks, and asked about benchmark comparisons. It turned out that yeah, Ferron is close to NGINX's reverse proxy performance.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Thank you so much! I want to put a line from your comment on Ferron's website as social proof. :)
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Heartbleed might be more than 10 years old, but it was a serious vulnerability indeed...

From https://www.heartbleed.com

> The Heartbleed bug allows anyone on the Internet to read the memory of the systems protected by the vulnerable versions of the OpenSSL software. This compromises the secret keys used to identify the service providers and to encrypt the traffic, the names and passwords of the users and the actual content. This allows attackers to eavesdrop on communications, steal data directly from the services and users and to impersonate services and users.

Also, the program being memory-safe doesn't mean it's bug-free, other bugs not related to memory safety exist (like path traversals are due to improper sanitation or checking of the input).

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
When installed for example with the installer script, Ferron would run on a specialized user for running the web server. Ferron itself would also have "CAP_NET_BIND_SERVICE" capability set on its binary, so that it doesn't have to run as root.
dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Yeah, it can be risky if Ferron servers get somehow compromised...

The best bet would be using official distro repositories...

But for now, I'm providing the .deb packages, so that people can easily install Ferron on Debian and alike.

dorianniemiec··on Show HN: I'm rewriting a web server written in Rust for speed and ease of use
Well, you're probably talking about the automatic TLS demo. People installing Ferron on their servers don't have to use this demo!
dorianniemiec··on The Grand Digital Paradox: Why Indian Government Websites Feel Stuck in Time
Yeah, examples of such sites can be useful to see what's going on.
dorianniemiec··on Show HN: Gitcasso – Syntax Highlighting and Draft Recovery for GitHub Comments
The idea seems good - this can make Markdown in the comment editor more readable!

But when I tried your Chrome extension, I found a problem - the comment box became light mode, when GitHub is in dark mode...

I have opened a GitHub issue about this problem.

dorianniemiec··on My approach to building large technical projects (2023)
Interesting, especially the "Build for Yourself" section!

Building software for yourself can help you solve a problem you have. If you're also using the software yourself, you can fix bugs in the software. I found some bugs in a web server I'm building by trying to use it myself.

dorianniemiec··on FeOx Server – High-Performance, Drop-In Replacement for Redis
I found this project when browsing X, and I think it has some potential, as it's a high-performance drop-in replacement for Redis. Could be useful for some real-time web apps.
dorianniemiec··on Ferron 1.0.0: a new era for web servers
First, thank you everyone for the support you have shown for a web server that I am building, when I submitted its beta version!

I have now released the stable version of my web server, that can be used in production environments.

dorianniemiec··on Ferron – A fast, memory-safe web server written in Rust
The problem is that you will have more moving parts - a web server, and an additional reverse proxy (which can add overhead). Also, Ferron can also be configured as a reverse proxy.
dorianniemiec··on Ferron – A fast, memory-safe web server written in Rust
Thank you!
dorianniemiec··on Ferron – A fast, memory-safe web server written in Rust
You went to the documentation page while I was uploading the website files after I updated the website. You can now refresh the documentation page.
dorianniemiec··on Ferron – A fast, memory-safe web server written in Rust
Regarding the server performance, there are benchmark results on the Ferron's website.
dorianniemiec··on Ferron – A fast, memory-safe web server written in Rust
How? I rather think that it uses a borrow checker with ownership and borrowing rules.
← PreviousPage 2 of 4Next →