News for hackers. Stuff that matters.
Re:OpenBSD, C, httpd and SQLite – Web App stack by sfifs on Saturday June 09, 2018 @11:27AM (#17273479)
Many small programs simply doesn't scale to the modern web when just the baggage associated with spinning up processes will kill you at any reasonable load. UNIX has nice ideas but recognise they were founded in the shared computer between a few dozen users environment of the 70s, not a web server serving thousands of requests a second of today
Re:OpenBSD, C, httpd and SQLite – Web App stack by bitofhope on Saturday June 09, 2018 @12:31PM (#17273741)
What do you mean by modern web? I don't see how modernity implies more load, at least for fork() bottlenecked programs specifically.

If you're serving thousands of requests per second, you probably need a pretty beefy server anyway, regardless of the stack you're running. Forking makes good use of multiprocessor capabilities if nothing else.

Re:OpenBSD, C, httpd and SQLite – Web App stack by sfifs on Saturday June 09, 2018 @10:08PM (#17276049)
Modern language runtimes used in the server space like Go basically multiplex green threads across processes to minimize context switches between concurrent execution paths. By leveraging the fact that I/O is much slower than processor ops and switching green threads on I/O without necessarily always switching OS process, they easily scale to hundreds of thousands of concurrent requests. I don't really know about Erlang's model but it also has green threads. There's a reason why high traffic sites use languages like these.

https://talks.golang.org/2012/concurrency.slide#1

Re:OpenBSD, C, httpd and SQLite – Web App stack by laumars on Saturday June 09, 2018 @04:02PM (#17274703)
No, it really doesn't. Forking is expensive. Running a multithreaded (even if it's green threads rather than OS threads) http server and web application makes far better use of multi-processor capabilities.

Shell scripting is a handy tool but it is also slow so you wouldn't write hot paths in shell scripts. And for the same reasons you wouldn't write busy web servers in CGI. Both are fork() heavy.

Re:OpenBSD, C, httpd and SQLite – Web App stack by tonyarkles on Saturday June 09, 2018 @11:47AM (#17273555)
Isn't this basically what "serverless" is?
Re:OpenBSD, C, httpd and SQLite – Web App stack by sedachv on Saturday June 09, 2018 @12:23PM (#17273712)
Great observation. And in fact "serverless" is the way that Unix network servers used to work: https://en.wikipedia.org/wiki/Inetd

CGI is also the way the web used to work. Spawning processes has only gotten faster since then. The entire "process spawning doesn't scale to the modern web" argument is completely and totally bogus. Today, spawning a process in Linux is only 10-20 microseconds slower than creating a thread: http://www.bitsnbites.eu/benchmarking-os-primitives/

The performance problems are elsewhere.

Re:OpenBSD, C, httpd and SQLite – Web App stack by sfifs on Saturday June 09, 2018 @10:16PM (#17276069)
What you are missing here is the fact that I/O is orders of magnitude slower than processor. Most of the time in servers is spent waiting for I/O and multiplexing green threads on processes without context switches while some execution paths are waiting on I/O gives you far higher capacity on the same hardware. See the other comment thread on GP comment.
Re:OpenBSD, C, httpd and SQLite – Web App stack by sfifs on Saturday June 09, 2018 @09:56PM (#17276014)
serverless is primarily a decentralisation/small-scale/unpredictable workloads play where you trade off fixed costs of managing a dedicated instance for higher variable per call cost. At any reasonable scale and predictability, running a dedicated server is cheaper.

The folks who started at a small scale in serverless but see traffic growing and kind of are in the middle space before jumping to dedicated servers have an entire art form of keeping their functions "hot" since both Lambda and AppEngine actually keep your functions hot loaded when once it's spun up for some time.

https://www.google.com.sg/search?q=serverless+warm+up&oq=ser...