News for hackers. Stuff that matters.
Re:Althttpd: Simple webserver in a single C file by ankurpatel on Tuesday June 08, 2021 @09:55AM (#27435249)
Performance is really bad. This is good for running a small HTTP server on an embedded device but if plan is to use it for HTTP server to serve production web traffic performance is really bad. Below is report of running the server and hitting a minimal index.html page and hitting it with artillery.

All virtual users finished Summary report @ 09:39:57(-0400) 2021-06-08 Scenarios launched: 33645 Scenarios completed: 2573 Requests completed: 2573 Mean response/sec: 42.57 Response time (msec): min: 0 max: 9029 median: 2 p95: 6027.7 p99: 8778.8 Scenario counts: Get index.html: 33645 (100%) Codes: 200: 2573 Errors: ETIMEDOUT: 31008 EPIPE: 48 ECONNRESET: 16

Re:Althttpd: Simple webserver in a single C file by SQLite on Tuesday June 08, 2021 @10:12AM (#27435444)
Indeed. And a Citation biz-jet is way faster, flies higher, goes further, and carries more passengers than a Carbon Cub. On the other hand, the Citation costs more, burns more gas, takes more maintenance, and is more complex to fly, and you should not try to land a Citation on a sandbar in a remote Alaskan river.

Choose the right tool for the job.

Changing the https://sqlite.org/ website to run off of Nginx or Apache instead of alhttpd would just increase the time I spend on administration and configuration auditing.

Re:Althttpd: Simple webserver in a single C file by jmercouris on Tuesday June 08, 2021 @03:04PM (#27439428)
It is not clear whether you would spend more time on administration with another webserver. I don't have experience with your webserver, but mine are 'set it' and 'forget it' affairs.
Re:Althttpd: Simple webserver in a single C file by dsalzman on Tuesday June 08, 2021 @11:39AM (#27436596)
Love the Carbon Cub reference. STOL!!
Re:Althttpd: Simple webserver in a single C file by krferriter on Tuesday June 08, 2021 @10:30AM (#27435656)
And yet in years of using sqlite I have never once had a problem loading their website.
Re:Althttpd: Simple webserver in a single C file by dmux on Tuesday June 08, 2021 @10:09AM (#27435414)
>but if plan is to use it for HTTP server to serve production web traffic performance is really bad.

But it seems to be "good enough", no? As stated on the page, it serves 500k requests a day.

Were you running your tests using xinetd or stunnel?

Re:Althttpd: Simple webserver in a single C file by speg on Tuesday June 08, 2021 @10:15AM (#27435476)
It serves sqlite.org just fine.

Most people don’t need FANG tools.

Re:Althttpd: Simple webserver in a single C file by 0xbadcafebee on Tuesday June 08, 2021 @10:47AM (#27435878)
I'm not sure I would call Apache or Nginx "FANG tools" (or FAANG tools)
Re:Althttpd: Simple webserver in a single C file by nine_k on Tuesday June 08, 2021 @06:50PM (#27442114)
The design goal is not top performance here. It is simplicity, observability of the source, and security.

It absolutely will fail under a DDoS-like punishing load which, say, nginx would have a chance to fend off.

It's still plenty adequate for many real-world configurations and load patterns, much like Apache 1.x has been. Only this is like 2% the size of the Apache 1.x.

Re:Althttpd: Simple webserver in a single C file by 40four on Tuesday June 08, 2021 @03:29PM (#27439686)
Fair enough, but when considering the reasons and decisions behind using this server from the developers, isn’t your point kind of moot?

It’s not optimized for high ‘performance’. It’s optimized for low resource usage, and the ability to reliably serve large amounts of requests on a small budget, right?

They state that the website is currently serving 500K requests & 50GB of bandwidth per day. Respectfully, this is quite the opposite of your ‘only good for small embedded devices’ claim.

I think this is very interesting, and I’m glad I know this exists now! Worth considering if you have the right type of use case.

Re:Althttpd: Simple webserver in a single C file by wubawam on Tuesday June 08, 2021 @03:47PM (#27439886)
That's not a lot of requests.

My hobby website serves more traffic for a 1/4 of the cost and is easy to configure.

Re:Althttpd: Simple webserver in a single C file by charsi on Wednesday June 09, 2021 @06:51AM (#27446453)
Care to mention what you are using for your hobby project?
Re:Althttpd: Simple webserver in a single C file by nodesocket on Tuesday June 08, 2021 @09:33PM (#27443244)
It's a cool demo, but obviously would not recommend running in any production environment. It's not battle tested (performance and security) and not constantly peer-reviewed like Apache or NGINX. Even further down the totem pole Caddy (which I really like) is better than Althttpd for lots of very good reasons. Ok, with what I thought would be obvious said; Althttpd it's still way cool and impressive.
Re:Althttpd: Simple webserver in a single C file by e12e on Tuesday June 08, 2021 @01:25PM (#27438150)
> hitting it with artillery

This?

https://github.com/artilleryio/artillery

Re:Althttpd: Simple webserver in a single C file by ankurpatel on Wednesday June 09, 2021 @10:25AM (#27448234)
Yes