
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
|