Return-Path: X-Original-To: apmail-kafka-users-archive@www.apache.org Delivered-To: apmail-kafka-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01B76E417 for ; Tue, 22 Jan 2013 20:27:04 +0000 (UTC) Received: (qmail 8245 invoked by uid 500); 22 Jan 2013 20:27:03 -0000 Delivered-To: apmail-kafka-users-archive@kafka.apache.org Received: (qmail 8222 invoked by uid 500); 22 Jan 2013 20:27:03 -0000 Mailing-List: contact users-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@kafka.apache.org Delivered-To: mailing list users@kafka.apache.org Received: (qmail 8212 invoked by uid 99); 22 Jan 2013 20:27:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 20:27:03 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_STOCK2 X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pablo.barrera@gmail.com designates 209.85.219.41 as permitted sender) Received: from [209.85.219.41] (HELO mail-oa0-f41.google.com) (209.85.219.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 20:26:55 +0000 Received: by mail-oa0-f41.google.com with SMTP id k14so7655920oag.28 for ; Tue, 22 Jan 2013 12:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=juKuKyPy47iwGgtAoKtYjKsZK6lXmAk/q20geEdB7yg=; b=KDOA5dDuwpJ8F6iJyv+YUKFiW9oZOlftSPhEpmP12tQ4UpDnmZTXr63C3xlmKYz6DZ BvH/CXLFEw36dljWawGSImulsvp/mgayb2ShEw7gOwI0D90grQDn5FyH5TIhz5YthwNP NPh5AbAI6FNo4LAGQgWI6kxVNRKEZhhtJUCYEqQ8BAJ34ZvlI9Zb7iwZqgYMuxi301Sf FELm58ihTxg/9AJL0Lmk2WpRBp1prKSumv2YMZFzn/rh09tKxTUUcAY4wB6t2qnJVjDo FjiyBbNlXiRdZWdlQpyEjbfSMW+wEwVrKCwTEOthwurxYfEIm2TWFghlNjDlN/mYtef4 6R0Q== MIME-Version: 1.0 X-Received: by 10.182.92.70 with SMTP id ck6mr17978407obb.46.1358886394538; Tue, 22 Jan 2013 12:26:34 -0800 (PST) Received: by 10.60.40.226 with HTTP; Tue, 22 Jan 2013 12:26:34 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Jan 2013 21:26:34 +0100 Message-ID: Subject: Re: Cross-site Kafka installation From: =?UTF-8?Q?Pablo_Barrera_Gonz=C3=A1lez?= To: users@kafka.apache.org Content-Type: multipart/alternative; boundary=14dae93b63dad62aa404d3e664ad X-Virus-Checked: Checked by ClamAV on apache.org --14dae93b63dad62aa404d3e664ad Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Joel Thanks for the hints. Apparently it was a configuration error at operating system level. We are using Debian Linux. Kafka uses setsockopt call with SO_SNDBUF to setup the buffer size (socket.send.buffer). The operating system then set the real buffer size to min(socket.send.buffer, net.core.wmem_max). net.core.wmem_max was set to a really small value (131071), that was Debian Linux default. However, if you delegate the buffsize to the operating system (basically you don't call to setsockopt for SO_SNDBUF), the operating system handles the buffer size using the configuration in net.ipv4.tcp_wmem. The default values for our hosts were 4096, 16384, 4194304, meaning that a buffer can automatically grow up to 4MB (if there is enough memory available). Having such an small window was the main reason for the low performance. With the new configuration we increased performance by an order of magnitude. The interesting think is that, at least in Linux, if you don't call to setsockopt the default buffer works really well. I don't notice any difference between calling to setsockopt or not (after fixing the configuration of the machine). So why to setsockopt? Anyway, I see value on using configuration to turn on or off the call to setsockopt. I will send a patch. Regards, Pablo PS: We are using 0.7.1 and Linux 2.6.32. 2013/1/22 Joel Koshy > > We do mirroring across data-centers (but in the same continent). You should > basically set a high fetch size and socket buffer size in such scenarios. > > In general, you should set a high value for the socket buffer size on the > consumer configuration (socket.buffersize) and the source cluster's broke= r > configuration (socket.send.buffer). > > Assuming you are using the high-level consumer, the fetch size (fetch.size) > should be higher than the consumer's socket buffer size. Note that the > socket buffer size configurations are a hint to the underlying platform's > networking code. If you enable trace logging, you can check the actual > receive buffer size and determine whether the setting in the OS networkin= g > layer also needs to be adjusted. Likewise, you will need to use higher > connection/session timeouts for zookeeper and set your offset commit > intervals to be fairly large. > > Thanks, > > Joel > > > On Mon, Jan 21, 2013 at 2:04 PM, Pablo Barrera Gonz=C3=A1lez < > pablo.barrera@gmail.com> wrote: > > > Hello > > > > In my enterprise we are deploying an cross-site installation of Kakfa. One > > of the Kafka cluster is located in USA and one consumer is in Europe. Does > > anybody have experience in such an environment? Any comments on the > > configuration and best practices? > > > > Thanks in advance > > > > Pablo > > --14dae93b63dad62aa404d3e664ad--