hakkr has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way to load balance web page and CGI requests to an Apache Server.
Is it
1.Somehow redirect all requests to a Perl round robin hand made solution?
2.Use a CPAN modules like Schedule::Load?
3. Use an Apache Module?
4. Buy a commercial solution

Also does anyone know the best way to load balance Mysql queries from a CGI?

Replies are listed 'Best First'.
Re: Getting Loaded
by ask (Pilgrim) on Nov 30, 2001 at 17:18 UTC
    You need to tell us more about your requirements. How much traffic; what kind of application; how many servers, etcetera.

    There is the Linux Virtual Server project for making a load balancer. I don't know how far that will scale. The right commercial loadbalancers can easily scale to hundreds of megabits per second and many thousand requests per second. I have good experiences with that using equipment from Foundry Networks (http://www.foundrynetworks.com/).

    If you are using CGI now, the first thing you should do to scale better would be installing mod_perl.

    The best way to scale MySQL (and other SQL databases) is by caching as much as possibly as close to the application as possibly. http://develooper.com/modperl/

     - ask

    -- 
    ask bjoern hansen, http://ask.netcetera.dk/   !try; do();
    
      I want to have 2+ servers with identical html files, CGI and databases. So I need a solution to balance requests to the domain between these 2+ servers. Traffic: I have to be able to add servers as required. Must eventually be able to provide service for 10,000 users Application: High availabilty Search Engines.

        If you are dealing with a session-less application, or if you plan on maintaining all of your session data in a database, then my suggestion would be to just use round-robin DNS for now. When you get to the 10,000 user level, I suspect you'll be using many more than 2 servers, and it might become worth it to look into a hardware solution at that point.

Re: Getting Loaded
by guha (Priest) on Nov 30, 2001 at 18:06 UTC
    Might I suggest that you look into this link by the mighty merlyn where he creates a poor man's load balancer for the WebTechniques Column.

Re: Getting Loaded
by DrManhattan (Chaplain) on Nov 30, 2001 at 20:11 UTC
Re: Getting Loaded
by yodabjorn (Monk) on Aug 26, 2002 at 21:49 UTC
    Personally I use the Linux Virtual Server (ipvs)
    Relativly easy to setup and verry powerfull..


    An intellectual is someone whose mind watches itself.
    - Albert Camus