Live data from Hacker News

BCHS stack – BSD, C, httpd, SQLite

learnbchs.org

21–30 of 59 posts

Re: BCHS stack – BSD, C, httpd, SQLite

#21

Does anyone actually use this?

While I think quite a few people use this, I question the actual benefits. People often argue with performance, but unless you spend a lot of work into doing things right, the general "C backend" won't outperform even simple things like nodejs ... at least once you reach the realm of ten-thousands of requests per second coupled with more than just a static page, "hello world" and a for-loop. Same goes for the "DBMS" part of things, being the bottleneck for the majority of real world applications anyway.

I think the best use case would be some static content delivery coupled with a few dynamic pages and APIs backed up by SQLite here and there ...

Some references would be cool I guess. Anyone?

Re: BCHS stack – BSD, C, httpd, SQLite

#24

Using a ARNP stack here (ArchLinux, Rust, nginx, PostgreSQL). It works great.

I'm running a moderately popular website with this stack on a $5 VPS. More precisely I'm running an ARNPCoW (Cloudflare or WireGuard) stack. That is, an ARNP stack that serves https from behind Cloudflare and drops packets that don't come from one of Cloudflare's advertised IPs unless they are from a WireGuard connection.

Re: BCHS stack – BSD, C, httpd, SQLite

#26

Doing web development in c and getting that sweet performance boost is very tempting but the time it takes to develop even a simple website is just not worth it. I would rather spend a few pound extra on servers and goto the cinema than the hours of developer time it would take to build PHP sites in C++

You just using some "framework" to develop C++ apps. This framework should give you place for you DO_FUNCTION() and everything else is implemented: 80-port-listening, DB-interaction and so on.

Re: BCHS stack – BSD, C, httpd, SQLite

#27
post #12

Writing web-facing code in C in 2021 is seldomly a good idea, even if it runs on OpenBSD in a jail.

It is good idea in terms of long-term money spendings: if you already have good C++ HTTP framework, you spend less cpu/memory and can make web-service\site that can live forever for 0.00001 dollars a month. Of if you planning to serve lost of requests AND want users to feel low latency responce, you have no options: Rust, Go, C++, maybe something else. Main fight must occur on the "C++ vs Rust" scene, but C++ certainly wont die in another 20 yers, so you happy using it for long-term projects.

Re: BCHS stack – BSD, C, httpd, SQLite

#28
post #18
post #10

Replace C/httpd with golang and you get a stack that's fairly decent.

I can recommend Go for this too. I use it for small APIs. Go has really easy cross compiling as well, so deploying from Linux to OpenBSD is really simple. I still use httpd as the proxy but use compiled Go executables for CGI.

Like real CGI, as an executable in cgi-bin?

Re: BCHS stack – BSD, C, httpd, SQLite

#30

Trying to make the term BCHS a thing just isn’t going to happen.

Gretchen, stop trying to make fetch() happen! Seriously, how are you supposed to pronounce BCHS?

I believe that officially it Beaches, but you know, there’s a joke in there somewhere.
Post reply on HN