FAQ
Does anyone know if it's possible to distribute requests to multiple external
FastCGI servers with Apache2 + mod_fastcgi similar to the round-robin
load-balancing approach lighttpd provides? I have this large legacy app running
on mod_perl behind an apache2 reverse proxy where I'd like to plug in my new
Catalyst app via FastCGI which eventually should run on more than one physical
app server. If possible I'd like to stick with Apache2 as the reverse proxy for
now ...

Thanks!

--Tobias

Search Discussions

  • Adeola Awoyemi at Aug 2, 2007 at 4:08 pm

    Tobias Kremer wrote:
    Does anyone know if it's possible to distribute requests to multiple external
    FastCGI servers with Apache2 + mod_fastcgi similar to the round-robin
    load-balancing approach lighttpd provides? I have this large legacy app running
    on mod_perl behind an apache2 reverse proxy where I'd like to plug in my new
    Catalyst app via FastCGI which eventually should run on more than one physical
    app server. If possible I'd like to stick with Apache2 as the reverse proxy for
    now ...
    This is possible (as I have done the same) by adding multiple instances of:

    FastCgiExternalServer /path/to/MyApp/script/myapp_fastcgi.pl -host
    127.0.0.1:55901

    to the apache2 config file. Also make sure you use different ports or
    sockets.

    Adeola.


    --
    Creative Developer - Digital Craftsmen Ltd
    Exmouth House, 3 Pine Street
    London, EC1R 0JH
    t: +44 20 7183 1410
    f: +44 20 7099 5140
    m: +44 79 3952 0786
    w: http://www.digitalcraftsmen.net/
  • Tobias Kremer at Aug 3, 2007 at 8:54 am

    Tobias Kremer wrote:
    Does anyone know if it's possible to distribute requests to multiple external
    FastCGI servers with Apache2 + mod_fastcgi similar to the round-robin
    load-balancing approach lighttpd provides?
    This is possible (as I have done the same) by adding multiple instances of:
    FastCgiExternalServer /path/to/MyApp/script/myapp_fastcgi.pl -host
    127.0.0.1:55901
    to the apache2 config file. Also make sure you use different ports or
    sockets.
    I already tried that and it gives me:

    FastCgiExternalServer: redefinition of previously defined
    class "/srv/myapp.fcgi".

    I'm using mod_fastcgi-SNAP-0404142202 with Apache 2.0.59 both compiled
    from source.

    --Tobias
  • Adeola Awoyemi at Aug 3, 2007 at 2:13 pm

    Tobias Kremer wrote:
    Tobias Kremer wrote:
    Does anyone know if it's possible to distribute requests to multiple external
    FastCGI servers with Apache2 + mod_fastcgi similar to the round-robin
    load-balancing approach lighttpd provides?
    This is possible (as I have done the same) by adding multiple instances of:
    FastCgiExternalServer /path/to/MyApp/script/myapp_fastcgi.pl -host
    127.0.0.1:55901
    to the apache2 config file. Also make sure you use different ports or
    sockets.
    I already tried that and it gives me:

    FastCgiExternalServer: redefinition of previously defined
    class "/srv/myapp.fcgi".

    I'm using mod_fastcgi-SNAP-0404142202 with Apache 2.0.59 both compiled
    from source.
    Do you have each FastCgiExternalServer directive pointing to a different
    instance of the application. E.g.

    FastCgiExternalServer /path/myapp_fastcgi.pl -host 127.0.0.1:55900
    FastCgiExternalServer /path2/myapp_fastcgi.pl -host 127.0.0.1:55901

    Adeola.

    --
    Creative Developer - Digital Craftsmen Ltd
    Exmouth House, 3 Pine Street
    London, EC1R 0JH
    t: +44 20 7183 1410
    f: +44 20 7099 5140
    m: +44 79 3952 0786
    w: http://www.digitalcraftsmen.net/
  • Tobias Kremer at Aug 3, 2007 at 3:06 pm

    Tobias Kremer wrote:
    FastCgiExternalServer: redefinition of previously defined
    class "/srv/myapp.fcgi".

    I'm using mod_fastcgi-SNAP-0404142202 with Apache 2.0.59 both compiled
    from source.
    Do you have each FastCgiExternalServer directive pointing to a different
    instance of the application. E.g.

    FastCgiExternalServer /path/myapp_fastcgi.pl -host 127.0.0.1:55900
    FastCgiExternalServer /path2/myapp_fastcgi.pl -host 127.0.0.1:55901
    Nope. What does your Alias directive look like for this? How do
    you specify the other app instance (path2/myapp_fastcgi.pl)? Or do you
    have a different approach that doesn't use Alias?

    Anyways, I just switched over to lighttpd on a dedicated machine and the
    load-balancing worked perfectly within a couple of minutes :)

    --Tobias
  • Adeola Awoyemi at Aug 3, 2007 at 3:33 pm

    Tobias Kremer wrote:
    Tobias Kremer wrote:
    FastCgiExternalServer: redefinition of previously defined
    class "/srv/myapp.fcgi".

    I'm using mod_fastcgi-SNAP-0404142202 with Apache 2.0.59 both compiled
    from source.
    Do you have each FastCgiExternalServer directive pointing to a different
    instance of the application. E.g.

    FastCgiExternalServer /path/myapp_fastcgi.pl -host 127.0.0.1:55900
    FastCgiExternalServer /path2/myapp_fastcgi.pl -host 127.0.0.1:55901
    Nope. What does your Alias directive look like for this? How do
    you specify the other app instance (path2/myapp_fastcgi.pl)? Or do you
    have a different approach that doesn't use Alias?
    I used something like:
    <VirtualHost *>
    ServerName one.example.com
    Alias / /path/myapp_fastcgi.pl/
    ...
    </VirtualHost>
    <VirtualHost *>
    ServerName two.example.com
    Alias / /path2/myapp_fastcgi.pl/
    ...
    </VirtualHost>
    Anyways, I just switched over to lighttpd on a dedicated machine and the
    load-balancing worked perfectly within a couple of minutes :)
    Oh well, I guess you don't need to faff around with fastcgi anymore then ;-)

    Glad you have it sorted.

    Adeola.

    --
    Creative Developer - Digital Craftsmen Ltd
    Exmouth House, 3 Pine Street
    London, EC1R 0JH
    t: +44 20 7183 1410
    f: +44 20 7099 5140
    m: +44 79 3952 0786
    w: http://www.digitalcraftsmen.net/
  • Aristotle Pagaltzis at Aug 3, 2007 at 7:16 am

    * Tobias Kremer [2007-08-02 16:45]:
    Does anyone know if it's possible to distribute requests to
    multiple external FastCGI servers with Apache2 + mod_fastcgi
    similar to the round-robin load-balancing approach lighttpd
    provides?
    You just made me look for mod_proxy_fcgi again? a pity that the
    effort seems to have stalled and died. It would have provided
    FastCGI deployments with all the knobs and twiddles for load
    balancing that mod_proxy offers.

    Regards,
    --
    Aristotle Pagaltzis // <http://plasmasturm.org/>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedAug 2, '07 at 3:33p
activeAug 3, '07 at 3:33p
posts7
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase