On Wed, 20 Nov 2013 22:26:27 GMT, Jacek Furmankiewicz wrote:

For (b), the main vibe.d page mentions that it fully supports multi-threading, but does not really give an example of how to code it properly.

    auto options = new HTTPServerSettings();
    options |= HTTPServerOption.distribute;
    enableWorkerThreads();

This should spawn thread count equal to processor core count so that they share same listening socket and get assigned incoming connections by OS mechanisms. It can greatly simplify architecture of your application if you need to shared some synchronized state between workers (which is usually to be avoided but reality differs) but for completely independent request handling logic should not given any real advantages vs "multiple processes + load balancer" approach.

That said, worker thread feature has not been tested that much and was mostly added to get rid of my whining :) So if you don't feel the courage to report possible bugs, spawning processes should be safer way to go.

Any sort of threading other than worker model is often harmful to network server performance so there is no point of seeking it "just because you can".