Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 40375 invoked from network); 25 Sep 2006 06:20:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2006 06:20:26 -0000 Received: (qmail 42281 invoked by uid 500); 25 Sep 2006 06:20:22 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 42238 invoked by uid 500); 25 Sep 2006 06:20:22 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 42227 invoked by uid 99); 25 Sep 2006 06:20:22 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Sep 2006 23:20:22 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=snacktime@gmail.com; spf=pass Authentication-Results: idunn.apache.osuosl.org header.from=snacktime@gmail.com; domainkeys=good X-ASF-Spam-Status: No, hits=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE Received-SPF: pass (idunn.apache.osuosl.org: domain gmail.com designates 66.249.82.232 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [66.249.82.232] ([66.249.82.232:54222] helo=wx-out-0506.google.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 2D/89-13750-42577154 for ; Sun, 24 Sep 2006 23:20:21 -0700 Received: by wx-out-0506.google.com with SMTP id s19so1773617wxc for ; Sun, 24 Sep 2006 23:20:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=g6ghTdOa7mUrV4bQFXLq3spyUIVMsZTX9Oux76W+crhdbElIc2HEYX9q2FDK4iCGMuChHNmKMi8OU9gV7Gngi5SGhOTOK5jinQqMDEQVb1CYoPpfnlVC7enOnkFzB0blR6x7yfNvUT/HmRr59Q8bfvdYiXtcNSDFqc2OO5N6t+0= Received: by 10.90.93.6 with SMTP id q6mr203512agb; Sun, 24 Sep 2006 23:20:18 -0700 (PDT) Received: by 10.90.84.6 with HTTP; Sun, 24 Sep 2006 23:20:18 -0700 (PDT) Message-ID: <1f060c4c0609242320p7b0e89fey4469ad6b8a6ac3fd@mail.gmail.com> Date: Sun, 24 Sep 2006 23:20:18 -0700 From: snacktime To: dev@httpd.apache.org Subject: creating new lbmethod for mod_proxy_balancer MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I have very little C programming experience, but I've decided to tackle adding another load balancing method to mod_proxy_balancer. The reason for a new lbmethod is to have something that works nicely with ruby on rails. Both ruby and rails are not thread safe, which poses certain challenges. Right now the most popular way of hosting rails apps is using Mongrel http://mongrel.rubyforge.org/. Mongrel is a simple http server which loads and runs rails, but it can only process one request at a time due to rails not being thread safe. So a fairly good way to serve up rails is to have a cluster of mongrels behind apache using balancer. The problem is when you have a mix of short requests with longer requests. Mongrel will queue up connections but can only service one at a time, so one mongrel might have several slow requests queued up, and another mongrel might only be serving one request. So, what I'm trying to do is implement a new lbmethod that will only proxy a request to a balance member that has no requests currently being processed. If there are no more balance members available, I'm thinking the best thing is to implement a short wait cycle until a free mongrel is available, and possibly log a warning so you know that you need to add more mongrels to the cluster, and more balance members to apache. Any advice or hints are more then welcome, especially if for whatever reason this is going to get really complicated. Chris