web development in D

Adam D. Ruppe destructionator at gmail.com
Sun May 22 14:40:58 PDT 2011


Vladimir Panteleev wrote:
> But if your website is getting enough hits to generate more
> requests than the server can process, technology choice matters a
> lot.

Yeah. I've never had that happen, so I don't really know. If it
happens, it's easy enough to change later. (it was a two line change
just now to switch it to built-in webserver - none of the actual
app code needs to change at all)

> Is there any reason you didn't go for FastCGI or SCGI?

The biggest reason is they are harder to implement, and it's
premature optimization. I didn't want to spend a lot of extra
time writing code that would never be needed!


Secondary benefits are simplicity and reliability. A CGI process
can segfault without affecting anyone else. It can go completely
wild on memory, and it doesn't matter because it's short-lived
anyway. It can deployed to any server with ease - just copy
the binary in there. Worst case, you add a couple lines to
.htaccess.

Apache (or IIS) also handles logging and other details for a CGI
program.


It's just simpler in a lot of ways.


More information about the Digitalmars-d-learn mailing list