Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 29185 invoked from network); 28 Aug 2010 21:45:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Aug 2010 21:45:29 -0000 Received: (qmail 35178 invoked by uid 500); 28 Aug 2010 21:45:28 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 35127 invoked by uid 500); 28 Aug 2010 21:45:27 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 35119 invoked by uid 99); 28 Aug 2010 21:45:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Aug 2010 21:45:27 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Aug 2010 21:45:21 +0000 Received: by wyi11 with SMTP id 11so5482999wyi.31 for ; Sat, 28 Aug 2010 14:45:01 -0700 (PDT) Received: by 10.227.69.202 with SMTP id a10mr2740984wbj.81.1283031901286; Sat, 28 Aug 2010 14:45:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.129 with HTTP; Sat, 28 Aug 2010 14:44:41 -0700 (PDT) In-Reply-To: <20100828213456.GA23023@alumni.caltech.edu> References: <4C794746.8040708@gmail.com> <4C79550E.1080907@gmail.com> <20100828213456.GA23023@alumni.caltech.edu> From: Benjamin Black Date: Sat, 28 Aug 2010 14:44:41 -0700 Message-ID: Subject: Re: Cassandra & HAProxy To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Aug 28, 2010 at 2:34 PM, Anthony Molinaro wrote: > I think maybe he thought you meant put a layer between cassandra internal > communication. No, I took the question to be about client connections. > There's no problem balancing client connections with > haproxy, we've been pushing several billion requests per month through > haproxy to cassandra. > Can it be done: yes. Is it best practice: no. Even 10 billion requests/month is an average of less than 4000 reqs/sec. Just not that many for a distributed database like Cassandra. > we use > > =A0mode tcp > =A0balance leastconn > =A0server local 127.0.0.1:12350 check > > so basically just a connect based check, and it works fine > Cassandra can, and does, fail in ways that do not stop it from answering TCP connection requests. Are you saying it works fine because you have seen numerous types of node failures and this was sufficient? I would be quite surprised if that were so. Using an LB for service discovery is a fine thing (connect to a VIP, call describe_ring, open direct connections to cluster nodes). Relying on an LB to do the right thing when it is totally ignorant of what is going across those client connections (as is implied by simply checking for connectivity) is asking for trouble. Doubly so when you use a leastconn policy (a failing node can spit out an error and close a connection with impressive speed, sucking all the traffic to itself; common problem with HTTP servers giving back errors). b