[dancer-users] Dancer2 deployment
wyml at etr-usa.com
Mon Nov 23 14:52:52 GMT 2015
On Nov 21, 2015, at 10:18 AM, Gabor Szabo <gabor at szabgab.com> wrote:
> that server is only capable to serve one client at a time.
While that is true, you need to keep that in perspective. “One client at a time” does not mean that you can’t have hundreds of people staring at a browser window that has rendered HTML returned from your app. Nor does it mean that if two of those users simultaneously click a link on that page that only one of those users will get content back.
The only downside of running with the “simple” default web server is that if two simultaneous HTTP connections come into the web server, the server will handle one, then the other, in whatever order the kernel serializes the connections.
This means that if you write your Dancer route handlers to be efficient, so that they return within a few milliseconds at most, you can in effect serve a great many clients, since most of them will be idle most of the time.
The single-threaded web server only breaks down when you start getting to load levels where the server is handling at least one connection all the time, so that allowing to to handle a second or third in parallel can provide some benefit.
Think of it like a highway: for almost all practical cases, a simple 2-lane highway suffices. You only need more than one lane in a given direction when the traffic load increases to the point where traffic would be bumper-to-bumper without the extra lane(s).
More information about the dancer-users