cgi - Perl Mojolicious - How to make it handle multiple connections at once? -
i setup quick mojolicious server this:
use mojolicious::lite; '/' => sub { $self = shift; sleep 5; #sleep here, i'm testing multiple connections @ once $self->render_text('hello world!'); }; app->start;
i start with: perl mojolicious.pl daemon --listen=https://127.0.0.1:3000
problem is, if run command concurrently:
time curl https://127.0.0.1:3000/ -k
it seems use 1 thread requests, because if make multiple requests @ once, can take longer 5 seconds. it's if queued up.
am missing here? i'm wanting use mojolicous, if can handle more 1 client @ time.
mojo daemon
standalone http server meant development use, not production, , runs single thread. production want either use fastcgi
option , fastcgi-supporting webserver, or install nice psgi-compatible server starman or starlet or plack::handler::fcgi or fastpass , do
plackup -s starman --port 3000 mojolicious.pl
Comments
Post a Comment