Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Notes on installing lighttpd and FastCGI for Catalyst

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


johncwang at gmail

Mar 7, 2006, 9:44 PM

Post #1 of 10 (1732 views)
Permalink
Notes on installing lighttpd and FastCGI for Catalyst

I recently got my Catalyst app running on lighttpd with load-balanced
FastCGI servers. Most notes I saw on the net discussed other frameworks so I
wrote some Catalyst-specific install notes if anyone is interested:

http://www.dev411.com/wiki/Installing_lighttpd_and_FastCGI_for_Catalyst

Comments appreciated.

John


moseley at hank

Mar 7, 2006, 10:33 PM

Post #2 of 10 (1620 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

On Tue, Mar 07, 2006 at 09:44:33PM -0800, John Wang wrote:
> http://www.dev411.com/wiki/Installing_lighttpd_and_FastCGI_for_Catalyst

What the advantage of running multiple FastCGI process managers on the
same machine?

MyApp/script/myapp_fastcgi.pl -l /tmp/myapp-0.socket -n 5 -d
MyApp/script/myapp_fastcgi.pl -l /tmp/myapp-1.socket -n 5 -d

How would that compare to running 10 fastcgi processes?

How did you decide on the number of processes you would need to run?


--
Bill Moseley
moseley [at] hank


_______________________________________________
Catalyst mailing list
Catalyst [at] lists
http://lists.rawmode.org/mailman/listinfo/catalyst


johncwang at gmail

Mar 7, 2006, 11:01 PM

Post #3 of 10 (1638 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

On 3/7/06, Bill Moseley <moseley [at] hank> wrote:
>
> What the advantage of running multiple FastCGI process managers on the
> same machine?


I'm not sure there is any. A few RoR posts had lighty calling multiple
FastCGI sockets but perhaps those are tied to a single FastCGI process a
piece, I didn't look too closely. I'm not sure if it's a worthwhile
configuration but included it just for completeness. If there's no reason
for it, I'll remove it.

My primary interest is in the load-balanced TCP config which isn't covered
in the C::E::FastCGI POD at the moment, but perhaps it can be included.

John


johncwang at gmail

Mar 8, 2006, 1:32 AM

Post #4 of 10 (1631 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

Here's a short article on getting Catalyst running on LiteSpeed. I may look
into some benchmarking with Catalyst in a little while.

http://www.dev411.com/wiki/Installing_LiteSpeed_and_FastCGI_for_Catalyst

John


moseley at hank

Mar 8, 2006, 7:12 AM

Post #5 of 10 (1635 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

On Tue, Mar 07, 2006 at 11:01:22PM -0800, John Wang wrote:
> On 3/7/06, Bill Moseley <moseley [at] hank> wrote:
> >
> > What the advantage of running multiple FastCGI process managers on the
> > same machine?
>
>
> I'm not sure there is any. A few RoR posts had lighty calling multiple
> FastCGI sockets but perhaps those are tied to a single FastCGI process a
> piece, I didn't look too closely. I'm not sure if it's a worthwhile
> configuration but included it just for completeness. If there's no reason
> for it, I'll remove it.

Don't remove it -- the more examples the better.

I wish I understood more of this. For example, what does defining
multiple servers do in lighttpd? When a request comes in how does it
decide which socket to use?

Is it possible that there's overhead in the process manager when a new
request comes in so that running multiple servers (even on the same
machine) mitigates that at bit?

Under forking Apache more processes are started as needed. But,
IIRC, the process manager has a static number of processes running.
Does this mean you should start more servers than you normally need
for the inevitable slashdotting?

Again, on Apache (and maybe lighttpd?) when using the server's
process manager ("static" mode) it's the same case -- a fixed number
of application processes (if I remember correctly).


> My primary interest is in the load-balanced TCP config which isn't covered
> in the C::E::FastCGI POD at the moment, but perhaps it can be included.

Good idea. Under Apache I assume it's just a matter of defining
multiple FastCgiExternalServer configs.


--
Bill Moseley
moseley [at] hank


_______________________________________________
Catalyst mailing list
Catalyst [at] lists
http://lists.rawmode.org/mailman/listinfo/catalyst


johncwang at gmail

Mar 8, 2006, 9:31 AM

Post #6 of 10 (1639 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

On 3/8/06, Bill Moseley <moseley [at] hank> wrote:
>
> On Tue, Mar 07, 2006 at 11:01:22PM -0800, John Wang wrote:
> > On 3/7/06, Bill Moseley <moseley [at] hank> wrote:
> > > What the advantage of running multiple FastCGI process managers on
> > > the same machine?


I did some more thinking about this. One benefit is that the FastCGI process
managers become hot-swappable so you don't have any downtime when reloading
a Catalyst app. If the update is backward compatible, you can simply reload
them sequentially and lighttpd will always have a FastCGI process available.
Also, if by chance an updated version causes problems, you can simply shut
down new processes and the server will continue to run with the existing
ones while debugging occurs. I'll mention this.

For example, what does defining
> multiple servers do in lighttpd? When a request comes in how does it
> decide which socket to use?


For sockets, it can just use the OS's socket handling facilities but I'm not
sure. I might ask over at lighttpd. Check out the listen man page:

http://www.die.net/doc/linux/man/man2/listen.2.html

For TPC, it is described on the lighttpd FastCGI page:

http://www.lighttpd.net/documentation/fastcgi.html#load-balancing

Under forking Apache more processes are started as needed. But,
> IIRC, the process manager has a static number of processes running.
> Does this mean you should start more servers than you normally need
> for the inevitable slashdotting?


I'm not sure how sites manage for large traffic spikes with a fixed number
of processes yet. In lighttpd if you use a static (perhaps 'captive' is a
better term?) FastCGI server, it can do adaptive spawning and add/remove
processes as needed, but then you'll have to restart the webserver when you
want to update your app. But it's an important issue. I'll look into it, but
later.

Under Apache I assume it's just a matter of defining
> multiple FastCgiExternalServer configs.


Multiple FastCgiExternalServer directives should work from reading some
fastcgi mailing list archives, however it seems like the default behavior
back in 2002 is round robin. Rnd map type also seems to be an option. Not
sure if there's been any changes since then. I just read the following blog
that says Apache's FastCGI support hasn't been the best but there's a
renewed interest now:

http://www.vmunix.com/mark/blog/archives/2006/01/02/fastcgi-scgi-and-apache-background-and-future/

John


danielmcbrearty at gmail

Jun 19, 2007, 1:49 PM

Post #7 of 10 (1326 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

Just a quick thanks to John for this tutorial. Remembering how long I
sweated over apache config stuff about a year back, I was really
dreading having a go at this. It took me about an hour to configure
lighty (I just used the standard ubuntu precompiled for now) to work
with myapp, and the config file is only 40 lines.

Oh how I love stuff that makes life simpler!

--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com
danmcb.vox.com
danmcb.blogger.com
BTW : 0873928131

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


kakimoto at tpg

Jun 5, 2009, 1:04 AM

Post #8 of 10 (1046 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

hi guys,

I'm facing some problems with
http://dev.catalyst.perl.org/wiki/deployment/lighttpd_fastcgi.

I followed the instructions and still can't get to anyone of my sites
listed below.

- www.myapp.com/ (production)
- www.myapp.com:59000/ (production)
- www.stage.myapp.com:59000/ (staging)

1) I still have the default "/etc/lighttpd/lighttpd.conf" existing. Is
that going to cause confusion?
2) Since the tute instructed us to make the
/etc/lighttpd/conf-available/20_stage.conf and
/etc/lighttpd/conf-available/20_prod.conf, should I start lighttpd with:
- lighttpd -f /etc/lighttpd/conf-available/20_stage.conf
- lighttpd -f /etc/lighttpd/conf-available/20_prod.conf

If that's the case, I reckon I should put in more config into the two
files mentioned (such as with document root and so forth)



I;m not very good with admin/setup of services, so guys, I would
appreaciate some input:)

thank you


K. akimoto


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


kakimoto at tpg

Jun 7, 2009, 5:51 AM

Post #9 of 10 (1023 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

Sorry, I'm just too excited in having to solve the problem. Have been
googling without much success hence the impatient postings.

Thanks for your response in relation to the matter. I will look at it soon!
thanks :)

K. akimoto:)

> You only waited 1 day. Reposting the entire message after such a
> short
> period is usually seen as bad behaviour.

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


kakimoto at tpg

Jun 7, 2009, 8:28 PM

Post #10 of 10 (1027 views)
Permalink
Re: Notes on installing lighttpd and FastCGI for Catalyst [In reply to]

hello Ash,
I looked through my config files again and have been successful in
running /etc/init.d/lighttpd with no errors in /var/log/lighttpd/error.log.

Based on the tutorial in
http://dev.catalyst.perl.org/wiki/deployment/lighttpd_fastcgi, can
anyone please tell me what are the urls for the set up of prod and
staging environments?

thank you


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.