Happy Saturday All, For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine? Thanks
hi Richard, you can, but that server is only capable to serve one client at a time. Starman is a much robust server. Gabor On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote:
Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
Hi Gabor, Thanks very much for the reply. Do you know of any videos or tutorials that deal specifically with a starman deployment? Thanks
El 21 nov 2015, a las 11:18 AM, Gabor Szabo <gabor@szabgab.com> escribió:
hi Richard,
you can, but that server is only capable to serve one client at a time. Starman is a much robust server.
Gabor
On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote: Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
I think this tutorial of Gabor's is a very gentle introduction to deployment: http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean Andrew On Sun, Nov 22, 2015 at 4:38 PM, Richard Reina <gatorreina@gmail.com> wrote:
Hi Gabor,
Thanks very much for the reply. Do you know of any videos or tutorials that deal specifically with a starman deployment?
Thanks
El 21 nov 2015, a las 11:18 AM, Gabor Szabo <gabor@szabgab.com> escribió:
hi Richard,
you can, but that server is only capable to serve one client at a time. Starman is a much robust server.
Gabor
On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote:
Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Andrew Solomon Mentor@Geekuni http://geekuni.com/ http://www.linkedin.com/in/asolomon
Question about this article. I am planning on using a digitalocean debian droplet. Is reinstalling perl via perlbrew really necessary? Thanks 2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
On Sun, Nov 22, 2015 at 4:38 PM, Richard Reina <gatorreina@gmail.com> wrote:
Hi Gabor,
Thanks very much for the reply. Do you know of any videos or tutorials that deal specifically with a starman deployment?
Thanks
El 21 nov 2015, a las 11:18 AM, Gabor Szabo <gabor@szabgab.com> escribió:
hi Richard,
you can, but that server is only capable to serve one client at a time. Starman is a much robust server.
Gabor
On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote:
Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Andrew Solomon
Mentor@Geekuni http://geekuni.com/ http://www.linkedin.com/in/asolomon
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
It is not "reinstall" it is "install another one while keeping the old one". It is not necessary, there are other solutions, but I find this one clean. Actually I usually use http://dwimperl.com/linux.html but then again, I build that myself for this purpose. Gabor On Tue, Nov 24, 2015 at 10:20 PM, Richard Reina <gatorreina@gmail.com> wrote:
Question about this article. I am planning on using a digitalocean debian droplet. Is reinstalling perl via perlbrew really necessary?
Thanks
2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
On Sun, Nov 22, 2015 at 4:38 PM, Richard Reina <gatorreina@gmail.com> wrote:
Hi Gabor,
Thanks very much for the reply. Do you know of any videos or tutorials that deal specifically with a starman deployment?
Thanks
El 21 nov 2015, a las 11:18 AM, Gabor Szabo <gabor@szabgab.com> escribió:
hi Richard,
you can, but that server is only capable to serve one client at a time. Starman is a much robust server.
Gabor
On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote:
Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
I am trying to get this to work but am having problems with daemon::control (I think). When I execute /usr/local/bin/starman --workers 3 /home/starman/Almslete-App/bin/app.psgi from the command line it works and dancer app is dancing. But with: program => '/usr/loca/bin/starman', program_args => [ '--workers', '3', '/home/starman/Almlete-App/bin/ap\ p.pgsi' ], in my starman.pl app the service starts but I get the follwing errors in /tmp/starman.err and dancer is not dancing at http://myip:5000 Can't exec "/usr/loca/bin/starman": No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348. Failed to exec /usr/loca/bin/starman --workers 3 /home/starman/Almlete-App/bin/ap\ p.pgsi: No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348. Any help would be appreciated. Thanks
Check your spelling - you have made at least two typos in the text you have pasted here. On 28 Nov 2015 16:23, "Richard Reina" <gatorreina@gmail.com> wrote:
2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
I am trying to get this to work but am having problems with daemon::control (I think).
When I execute /usr/local/bin/starman --workers 3 /home/starman/Almslete-App/bin/app.psgi from the command line it works and dancer app is dancing. But with:
program => '/usr/loca/bin/starman', program_args => [ '--workers', '3', '/home/starman/Almlete-App/bin/ap\ p.pgsi' ],
in my starman.pl app the service starts but I get the follwing errors in /tmp/starman.err and dancer is not dancing at http://myip:5000
Can't exec "/usr/loca/bin/starman": No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348. Failed to exec /usr/loca/bin/starman --workers 3 /home/starman/Almlete-App/bin/ap\ p.pgsi: No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348.
Any help would be appreciated. Thanks
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
I suspect you're missing 'l' off the end of "local" It should be program => '/usr/*local*/bin/starman', rather than program => '/usr/*loca*/bin/starman', Andrew On Sun, Nov 29, 2015 at 12:22 AM, Richard Reina <gatorreina@gmail.com> wrote:
2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
I am trying to get this to work but am having problems with daemon::control (I think).
When I execute /usr/local/bin/starman --workers 3 /home/starman/Almslete-App/bin/app.psgi from the command line it works and dancer app is dancing. But with:
program => '/usr/loca/bin/starman', program_args => [ '--workers', '3', '/home/starman/Almlete-App/bin/ap\ p.pgsi' ],
in my starman.pl app the service starts but I get the follwing errors in /tmp/starman.err and dancer is not dancing at http://myip:5000
Can't exec "/usr/loca/bin/starman": No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348. Failed to exec /usr/loca/bin/starman --workers 3 /home/starman/Almlete-App/bin/ap\ p.pgsi: No such file or directory at /usr/local/share/perl/5.20.2/Daemon/Control.pm line 348.
Any help would be appreciated. Thanks
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Andrew Solomon Mentor@Geekuni http://geekuni.com/ http://www.linkedin.com/in/asolomon
2015-11-28 18:28 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I suspect you're missing 'l' off the end of "local" It should be
program => '/usr/*local*/bin/starman',
rather than
program => '/usr/*loca*/bin/starman',
Andrew
Amelia and Andrew, Thank you for pointing out my errors. I was so focused on my ignorance that I overlooked carelessness. After correcting the typos it now works. Thank you also Gabor for putting together a fine tutorial.
2015-11-22 10:45 GMT-06:00 Andrew Solomon <andrew@geekuni.com>:
I think this tutorial of Gabor's is a very gentle introduction to deployment:
http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean
Andrew
Followed the tutorial above and it has worked great so far. However, I am now trying to install an SSL certificate and am following the instructions from digital ocean https://www.digitalocean.com/community/tutorials/how-to-install-an-ssl-certi... which calls for modifying the default block file. I am not sure how to proceed as I removed the file per the instructions of this tutorial root@s12:~# rm /etc/nginx/sites-enabled/default root@s12:~# ln -s /home/starman/nginx-demo.conf /etc/nginx/sites-enabled/ root@s12:~# service nginx restart The file nginx-demo.conf does not contain the line with 'listen' that I am supposed to edit to install the certificate. Any help would be greatly appreciated. Thanks, Richard
Try this article: http://perlmaven.com/getting-started-with-perl-dancer-on-digital-ocean Gabor On Sun, Nov 22, 2015 at 6:38 PM, Richard Reina <gatorreina@gmail.com> wrote:
Hi Gabor,
Thanks very much for the reply. Do you know of any videos or tutorials that deal specifically with a starman deployment?
Thanks
El 21 nov 2015, a las 11:18 AM, Gabor Szabo <gabor@szabgab.com> escribió:
hi Richard,
you can, but that server is only capable to serve one client at a time. Starman is a much robust server.
Gabor
On Sat, Nov 21, 2015 at 7:14 PM, Richard Reina <gatorreina@gmail.com> wrote:
Happy Saturday All,
For the past few months I've been playing around with dancer on a machine at home. I am wanting to now experiment with creating and perhaps deploying a simple web app on digitalocean. However, I am not clear why I need a web server such as Starman. Can I not just install Dancer2 and plackup like I do on my local machine?
Thanks
On Nov 21, 2015, at 10:18 AM, Gabor Szabo <gabor@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).
Having said all of that, I certainly do recommend running your Dancer app behind some kind of reverse proxy server. That will offload the static asset load from Dancer, putting it all on the proxy server. That gives you a kind of parallelism all by itself, since the proxy server will be fully concurrent: it can serve static assets from other threads/children while one of those is blocking on Dancer waiting for a dynamically-generated web page. Since most web page hits serve many more static assets than dynamic ones, it is perfectly sensible for most of the available resources to be taken up by the proxy server. If your web app is so “heavy” that it needs a large fraction of the computer’s available resources, you’re probably at a scale where you should be offloading static content onto a CDN.
At iVouch, we used Starman for several months, but ran into problems with processes that wouldn't terminate gracefully and pile on top of each other, causing eventual memory overruns. I know many folks here recommend Starman, but in a heavy production environment, Starman caused too many problems for us. So we switched to uWSGI and haven't looked back since... uWSGI is an amazing piece of software, and is well-supported and continuously updated because a lot of Python-based apps use it. It also happens to support Perl/PSGI applications out of the box, which is what drew us to it. https://uwsgi-docs.readthedocs.org/en/latest/ On top of uWSGI, we run nginx to offload the static asset load, handle SSL, resolve redirects, etc. The combination is dreamy; we've done extensive load testing and it all works super well and super fast. It took several weeks to fine-tune everything, and if there's interest, I'd be happy to post our "recipe" for deploying D1 on uWSGI on nginx. -----Original Message----- From: Warren Young Sent: Monday, November 23, 2015 6:59 AM To: Perl Dancer users mailing list Subject: Re: [dancer-users] Dancer2 deployment Having said all of that, I certainly do recommend running your Dancer app behind some kind of reverse proxy server. That will offload the static asset load from Dancer, putting it all on the proxy server. That gives you a kind of parallelism all by itself, since the proxy server will be fully concurrent: it can serve static assets from other threads/children while one of those is blocking on Dancer waiting for a dynamically-generated web page. Since most web page hits serve many more static assets than dynamic ones, it is perfectly sensible for most of the available resources to be taken up by the proxy server. If your web app is so “heavy” that it needs a large fraction of the computer’s available resources, you’re probably at a scale where you should be offloading static content onto a CDN. _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Would be very interested in the recipe please. We are well under way with a major development on starman, but have not tested under load yet - so you email caused me concern. Any other opinions on the views presented by Hermann? Z
-----Original Message----- From: dancer-users [mailto:dancer-users-bounces@dancer.pm] On Behalf Of Hermann Calabria Sent: 24 November 2015 21:03 To: Perl Dancer users mailing list <dancer-users@dancer.pm> Subject: Re: [dancer-users] Dancer2 deployment
At iVouch, we used Starman for several months, but ran into problems with processes that wouldn't terminate gracefully and pile on top of each other, causing eventual memory overruns. I know many folks here recommend Starman, but in a heavy production environment, Starman caused too many problems for us. So we switched to uWSGI and haven't looked back since... uWSGI is an amazing piece of software, and is well-supported and continuously updated because a lot of Python-based apps use it. It also happens to support Perl/PSGI applications out of the box, which is what drew us to it.
https://uwsgi-docs.readthedocs.org/en/latest/
On top of uWSGI, we run nginx to offload the static asset load, handle SSL, resolve redirects, etc.
The combination is dreamy; we've done extensive load testing and it all works super well and super fast. It took several weeks to fine-tune everything, and if there's interest, I'd be happy to post our "recipe" for deploying D1 on uWSGI on nginx.
-----Original Message----- From: Warren Young Sent: Monday, November 23, 2015 6:59 AM To: Perl Dancer users mailing list Subject: Re: [dancer-users] Dancer2 deployment
Having said all of that, I certainly do recommend running your Dancer app behind some kind of reverse proxy server. That will offload the static asset load from Dancer, putting it all on the proxy server.
That gives you a kind of parallelism all by itself, since the proxy server will be fully concurrent: it can serve static assets from other threads/children while one of those is blocking on Dancer waiting for a dynamically-generated web page. Since most web page hits serve many more static assets than dynamic ones, it is perfectly sensible for most of the available resources to be taken up by the proxy server.
If your web app is so “heavy” that it needs a large fraction of the computer’s available resources, you’re probably at a scale where you should be offloading static content onto a CDN. _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On Wednesday 25 November 2015 10:11:16 Zahir Lalani wrote:
Would be very interested in the recipe please.
We are well under way with a major development on starman, but have not tested under load yet - so you email caused me concern. Any other opinions on the views presented by Hermann?
Another upvote for uwsgi - it's lightweight, powerful, infinitely configurable and well supported. Basic usage is very simple: nginx has native support and just needs something like: location / { include uwsgi_params; uwsgi_pass unix:///home/dev/turtle/run/turtle.sock; # this or the tcp version below # uwsgi_pass 127.0.0.1:3077; # this allows separate uids for each app uwsgi_modifier1 5; } and then a basic app_name.ini at the same level as your config.yml with something like (from my local dev site) [uwsgi] uid = ic gid = ic socket = /home/dev/turtle/run/turtle.sock pidfile = /home/dev/turtle/run/turtle.pid psgi = /home/dev/turtle/bin/turtle.pl cheaper = 2 cheaper-initial = 5 workers = 15 master = true daemonize = true harakiri = 30 and an /etc/init.d/app rc file to control it, something like (on Gentoo anyway): prog="/usr/bin/uwsgi" prog_name="Turtle on Dancer with uWSGI" config="/home/dev/turtle/turtle.ini" pidfile="/home/dev/turtle/run/turtle.pid " start() { echo -n $"Starting $prog_name: " exec $prog --plugins psgi $config retval=$? echo [ $retval -eq 0 ] return $retval } ... Uwsgi has an absolute shed load of options over and above this, and I too would be very interested in seeing this recipe from Herman. Cheers Lyn
2015-11-24 23:02 GMT+02:00 Hermann Calabria <hermann@ivouch.com>:
The combination is dreamy; we've done extensive load testing and it all works super well and super fast. It took several weeks to fine-tune everything, and if there's interest, I'd be happy to post our "recipe" for deploying D1 on uWSGI on nginx.
I'd welcome to see you recipe. I used uwsgi/nginx combination on DigitalOcean's smallest droplet and my test app there is slower than I expected. So I look forward to learn about tuning it better. Thank you in advance. Wbr, -- Kõike hääd, Gunnar
2015-11-23 8:52 GMT-06:00 Warren Young <wyml@etr-usa.com>:
On Nov 21, 2015, at 10:18 AM, Gabor Szabo <gabor@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). _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Thank you Gabor, Andrew and Warren for your enlightening replies. Looks like I have additional decisions to make.
It is very easy to switch between using different servers; it's just a matter of changing the command line arguments to plackup. You can always start with the default server and experiment with using Starman (or other Plack servers). On 23 November 2015 at 08:40, Richard Reina <gatorreina@gmail.com> wrote:
2015-11-23 8:52 GMT-06:00 Warren Young <wyml@etr-usa.com>:
On Nov 21, 2015, at 10:18 AM, Gabor Szabo <gabor@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). _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Thank you Gabor, Andrew and Warren for your enlightening replies. Looks like I have additional decisions to make.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (9)
-
Amelia Ireland -
Andrew Solomon -
Gabor Szabo -
Hermann Calabria -
Lyn St George -
Richard Reina -
Warren Young -
WK -
Zahir Lalani