I setup a quick Mojolicious server like this:
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
sleep 5; #sleep here, I'm testing multiple connections at once
$self->render_text('Hello World!');
};
app->start;
I then start it with: perl Mojolicious.pl daemon --listen=https://127.0.0.1:3000
Problem is, if I run this command concurrently:
time curl https://127.0.0.1:3000/ -k
It seems to only use 1 thread for requests, because if I make multiple requests at once, they can take much longer than 5 seconds. It's as if they are all queued up.
Am I missing something here? I'm wanting to use Mojolicous, but only if it can handle more than one client at a time.
fork
, makes it work running under daemon, however. – Funkhouser