[Dancer-users] many dancer apps with Starman (part 3)
Mr. Puneet Kishor
punk.kish at gmail.com
Sun Jul 10 21:41:54 CEST 2011
In part 1 [http://www.backup-manager.org/pipermail/dancer-users/2011-July/001614.html] I dipped my toes into powering many apps on the same computer using Starman. I had a few errors, and the solutions, that I documented. I also received a very helpful reply from Pedro Melo [http://www.backup-manager.org/pipermail/dancer-users/2011-July/001617.html] suggesting that instead of one script for all the apps, I should fire up separate Starman processes for each app.
In part 2 [http://www.backup-manager.org/pipermail/dancer-users/2011-July/001616.html] I described a more generic scenario that would cover most of the circumstances I could dream of at the moment at my work.
In part 3, [http://www.backup-manager.org/pipermail/dancer-users/2011-July/001633.html], I described that I was getting a cryptic error from Plack::Builder complaining that there was an "Error while loading foo.psgi: Paths need to start with / at /Users/punkish/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Plack/Builder.pm line 89."
Now, taking Perdo Melo's advice, I am just launching separate Starman processes directly calling the `dancer -a` generated /path/to/webapp/bin/app.pl with
$plackup -E production -D -s Starman --workers=10 -p 5000 -a path/to/webapp/bin/app.pl
I change the port number for each app to match the apache proxy settings.
So, here I ask the following: the above is working, but is rapidly going to become cumbersome in three regards --
1. It will become tricky keeping track of the port numbers for each app, and make sure they match between what has been set in httpd.conf (for proxy purposes) and what has been used to call in the `plackup` command;
2. It will become very cumbersome shutting off or restarting one or more Starman app because I would have to find out the parent process of each app, and kill that in order to kill all the child workers; and
3. If I have 10 or 20 apps on the same server, with 10 Starman workers for each app, I would have 100 or 200 perl processes running on my computer even if my apps are really low traffic. I tried setting the number of workers to 2 or 2, but found that the server started dropping connections. Is having so many perl processes running not problematic?
More information about the Dancer-users
mailing list