Live data from Hacker News

SimpleW – Web Server Library .NET Core

github.com

41–50 of 80 posts

Re: SimpleW – Web Server Library .NET Core

#41
post #3

But why? ASP.NET Core is one of the best web frameworks, extremely modular and flexible. It's low level components (http server, routing) can be used as a foundation for new web frameworks.

One of the use cases that stands out to me is dropping an API into a console application without having to use a different project. With ASP.NET I have to set up a new project, use a different SDK and then re-register all my services in its service collection. It looks like this one is bringing it closer to how it's done in Go which I personally really like.

Re: SimpleW – Web Server Library .NET Core

#42
post #37

Earlier quoted context omitted.

Curious what the use-case is where JIT latency is an issue for a http service?

We are fairly high traffic. Deployments, even rolling, can and do cause fairly noticeable latency spikes and side effects like upstream services having to queue requests, pool escalations, all sorts. Warming stuff up before first hit is a complete bitch on top of that. I notice Apple had similar problems and moved some of their back end to Swift from JVM recently. There was a post on here.

Yep, downside of virtual language like that. Upside of Java/.Net is their extensive libraries and really good developer experience. Just like Golang GC caused Discord endless amount of headaches in some of their routes.

I have some heavy ASP.Net stuff too, yep, we have to prewarm it before putting into production.

Re: SimpleW – Web Server Library .NET Core

#43
post #11

Not sure about this one. It's based on NetCoreServer which is great but it's definitely not something I'd be comfortable putting into production over kestrel or IIS. From a performance standpoint, it is very difficult to beat kestrel now. If you don't want all the fancy Microsoft bullshit (I certainly don't), use the minimal APIs and map out routes to lightweight HttpContext handlers.

minimal APIs is microsoft bullshit also what does performance matter on webservers

Performance matters to me. I'm on a budget, running tiny Hetzner boxes. Every cycle counts.

Re: SimpleW – Web Server Library .NET Core

#44
post #30
post #17

Earlier quoted context omitted.

The library's tagline says "Powerfully Simple. Blazingly Fast." So there. ::folds arms:: Joking aside, I do agree that ASP.NET Core is a behemoth. On .NET 9, I just now did `dotnet new webapi` followed by `dotnet publish --self-contained -p:PublishSingleFile=true` and the binary is 103MB. That would blow up the size of a mobile app considerably, just to listen to HTTP. There a separate use case that SimpleW won't sol…

> The library's tagline says "Powerfully Simple. Blazingly Fast." > Joking aside author here. I agree with your remark ^^ Each time i read some news about a new framework with tag "blazingly fast", i'm thinking "lol". So i had to resist to the temptation... And finaly when doing a small benchmark, performances were not bad at all ( https://stratdev3.github.io/SimpleW/guide/performances.html ) and i let the "clickbait…

Did you try compiling all the test to native thru AoT? There are probably some optimizations to improve the Kestrel score by altering the config, or maybe changing how the API is written:

app.MapGet("/api/test/hello", () => "Hello World!");

As a general web server, I think I'd always go for Kestrel over this, but as another poster said, if you're trying to add an endpoint to some desktop application, this would be perfect.

Re: SimpleW – Web Server Library .NET Core

#45
post #15

Earlier quoted context omitted.

>ASP.NET Core is one of the best web frameworks ...based on what?

In total. Just compare different web frameworks by performance, flexibility, features and so on. Whatever you compare, ASP.NET Core will probably end up in the top 20%.

It's been really great since I've been able to develop on Windows and deploy to a cheap Linux VM instead of having to deal with IIS. Game-changing for me.

Re: SimpleW – Web Server Library .NET Core

#46

Does this mean a developer doesn't have to install nginx or iis ?

ASP.NET Core comes with its own built-in web server named Kestrel, which is very highly optimized. On most projects, I use it totally bare-metal, though I figure most run it behind a reverse proxy like nginx or yarp.

Re: SimpleW – Web Server Library .NET Core

#47
post #32

Does this mean a developer doesn't have to install nginx or iis ?

> Does this mean a developer doesn't have to install nginx or iis ? author here. You don't have to keep it behind a reverse proxy like nginx. But you can, especially if you have multiple APIs and you want to keep thing separated for security reason. Example : nginx:443 (reverse proxy, domain name routing) | |-> website1:8081 - docker container with SimpleW |-> website2:8082 - docker container with SimpleW | ...

A web server should never be directly exposed to the Internet, provided you care about the web server host or what's behind it.

Re: SimpleW – Web Server Library .NET Core

#48
post #17
post #3

But why? ASP.NET Core is one of the best web frameworks, extremely modular and flexible. It's low level components (http server, routing) can be used as a foundation for new web frameworks.

The library's tagline says "Powerfully Simple. Blazingly Fast." So there. ::folds arms:: Joking aside, I do agree that ASP.NET Core is a behemoth. On .NET 9, I just now did `dotnet new webapi` followed by `dotnet publish --self-contained -p:PublishSingleFile=true` and the binary is 103MB. That would blow up the size of a mobile app considerably, just to listen to HTTP. There a separate use case that SimpleW won't sol…

I hate when someone's software advertises itself as 'blazingly fast' and then provides NO DATA to back up the claim. It's possible that it really is blazingly fast, but to make the claim and provide no data is sad. In God we trust - all others please bring data.

Re: SimpleW – Web Server Library .NET Core

#49
post #47
post #32

Earlier quoted context omitted.

> Does this mean a developer doesn't have to install nginx or iis ? author here. You don't have to keep it behind a reverse proxy like nginx. But you can, especially if you have multiple APIs and you want to keep thing separated for security reason. Example : nginx:443 (reverse proxy, domain name routing) | |-> website1:8081 - docker container with SimpleW |-> website2:8082 - docker container with SimpleW | ...

A web server should never be directly exposed to the Internet, provided you care about the web server host or what's behind it.

> A web server should never be directly exposed to the Internet

That's what web servers are made for, no? Like Apache, Nginx etc. I mean, you could certainly put HAProxy in front but you'd need a good reason to do this.

Re: SimpleW – Web Server Library .NET Core

#50
post #11

Not sure about this one. It's based on NetCoreServer which is great but it's definitely not something I'd be comfortable putting into production over kestrel or IIS. From a performance standpoint, it is very difficult to beat kestrel now. If you don't want all the fancy Microsoft bullshit (I certainly don't), use the minimal APIs and map out routes to lightweight HttpContext handlers.

There's also Fast Endpoints[1], which Kind of the best of both worlds, minimal-API and REPR. 1: https://fast-endpoints.com/

Came to mention the same... really like FastEndpoints myself a lot.
Post reply on HN