3 ms·
> It actually does stuff that even current frameworks cannot achieve, such as providing long-lived stateful web apps entirely in HTML What? This was the norm
by kbenson 11y ago
> It actually does stuff that even current frameworks cannot achieve, such as providing long-lived stateful web apps entirely in HTML
What? This was the norm back in the day. It's not like all those Perl programmers writing CGIs or later PHP programmers writing PHP apps were using JS to tie it all together.
Or am I misunderstanding what you mean?
- rwmj 11y agoIt had two levels of persistence. There was a database layer for long term, persistent storage. But the clever(?) part was that the C threads persisted (in memory) beyond each single HTTP request. e.g. you could create a calculator web app where you would press buttons and have the calculator display numbers, and all that would be handled (across multiple requests) by a single C thread. The calculator display might be stored in a stack variable. Of course you can imagine ways for this to fail - restarting the webserver wasn't very nice for your users for example. Also you needed a smart front end which would direct user sessions back to the same web server instance. (And since it used cooperative threads, each core would be running a separate web server -- but this was 15 years ago when multicore machines were not too common).
- kbenson 11y agoAh, so this was possible, and occasionally done back then, but the real reason it wasn't was less to do with capability, and more to do with everyone wanting to ride on top of Apache. Apache handled a lot of stuff you wouldn't want to in a CGI (at that time), so it made sense to use it. Apache forked (and/or threaded depending on era), so variables shared in memory wasn't common. That said, people set up shared memory regions, or used file based sessions and /dev/shm, which is functionally the same, and had much the same thing.
- rwmj 11y agoThis is a ground-up web server rewrite, so it didn't use Apache, although we did (sometimes) front it with an Apache-based proxy.
- kbenson 11y agoOh, I understand that. I just used Apache as a reasoning for why most in the era weren't using memory based sessions. Also I think it's worth saying that I'm not trying to belittle your accomplishment, as it may have come across that way. Writing your own framework in the language you used to handle logic proved to be somewhat prescient of you, it's what numerous other projects ended up doing (Rails, Mojolicious, etc) for multiple reasons, which I'm sure you were able to take advantage of. I remember my own tests using ApacheBench ca. 2005 to test simple CGI performance vs mod_perl performance vs PHP vs Perl's HTTP::Daemon implementation with forking. When the workload is small, and the routing needs are simple, it's amazing how much overhead the webserver includes.