# run: hypnotoad myapp.pl # then (for 6 simultaneous clients) # for i in {1..6}; do echo $i; done | parallel -j 6 "echo '$0 : called with pid=$$ and param={}'; curl 'http://localhost:4444/' -o 'a{}'" # with no GNU parallel, do this: # for i in {1..6}; do wget 'http://localhost:4444/' -O a$i & done use Mojolicious::Lite; use Mojolicious::Plugin::OnFork; my $PORT = 4444; plugin OnFork => sub { print "FORKED with pid=$$ !\n"; }; get '/' => sub { my $c = $_[0]; sleep(1); $c->render( 'text' => "hello there from pid=$$\n" ); }; my $daemon = Mojo::Server::Daemon->new( app => app, listen => ["http://*:${PORT}"], single_accept => 0, keep_alive_timeout => 1, ); print "$0 : started listening on port ${PORT} (pid $$) ...\n"; $daemon->run;