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 2823A1819B for ; Wed, 27 May 2015 20:11:42 +0000 (UTC) Received: (qmail 24397 invoked by uid 500); 27 May 2015 20:11:41 -0000 Delivered-To: apmail-kafka-users-archive@kafka.apache.org Received: (qmail 24347 invoked by uid 500); 27 May 2015 20:11:41 -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 24335 invoked by uid 99); 27 May 2015 20:11:40 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2015 20:11:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 42A811A3584 for ; Wed, 27 May 2015 20:11:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.179 X-Spam-Level: ** X-Spam-Status: No, score=2.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=wikimedia.org Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Pn1ffOvL5lqo for ; Wed, 27 May 2015 20:11:39 +0000 (UTC) Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id AC98920539 for ; Wed, 27 May 2015 20:11:38 +0000 (UTC) Received: by qcmi9 with SMTP id i9so8945183qcm.0 for ; Wed, 27 May 2015 13:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wikimedia.org; s=google; h=from:content-type:subject:message-id:date:to:mime-version; bh=9SALabmUVSA0GxbgokLlwL+hks3SG/9nFLiGJAUCxag=; b=bOPYjvhdfBR8UIIpXEYI1k8uxNDs+6K7CztCGVOD0OnCPpcY6l2urj4VochB+l7Ttv k1fCzR3+MHRCa+528z6wbQU4zZR500knw9nsTo5S8hyEPgqj9F6acM1jyi7J+HhugMtk kkNOr/u3pHChf8MAKPvWmtupUSf0bzsIvk+2o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:subject:message-id:date:to :mime-version; bh=9SALabmUVSA0GxbgokLlwL+hks3SG/9nFLiGJAUCxag=; b=TRzi4pqG7ju4v6tklmVhhvW5omS3GA1KzytamUsTg8spnOCB+7RZkbaOm2olBkNAs+ I7RHYFvQj5NTN7u8WVkOPJt0NxNjxIyfofl1jCHiNqZjDYuYT6y/eGTtppLLjHLe5yDz 7NhSRqt2Y8jx40HJip/r3PykVk91QcT1KFzc81H6rdKniHHAZ/ymzoX6ELvhy+hLaaj2 KSWRNt9WCeKTUpwycHbvEWkJYreKObA/lImlvbocSIjqTf6txqJdBbTT7LSmFXEfI6ds Zu+yD1jg6rT79WFgw6Do2XAPJQZFpceXmU4D8Nu6Q0QV9sqmkRrf3hHRNjNBtLGxXNc7 2IjQ== X-Gm-Message-State: ALoCoQnQc3bFUFFHHtsDgq6FmXXbRLMzhZclT0fa0P/1C676EI1iP+8CQwNk00JuPGCmr7bLywqZ X-Received: by 10.140.135.80 with SMTP id 77mr20368926qhh.8.1432757497606; Wed, 27 May 2015 13:11:37 -0700 (PDT) Received: from [10.0.1.112] (ool-18e451d1.dyn.optonline.net. [24.228.81.209]) by mx.google.com with ESMTPSA id d69sm26415qhc.3.2015.05.27.13.11.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 May 2015 13:11:36 -0700 (PDT) From: Andrew Otto Content-Type: multipart/alternative; boundary="Apple-Mail=_E3F52462-6F37-409E-802E-34130319033E" Subject: Kafka partitions unbalanced Message-Id: <52850539-7499-402E-AC70-CC67567724A7@wikimedia.org> Date: Wed, 27 May 2015 16:11:34 -0400 To: users@kafka.apache.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) X-Mailer: Apple Mail (2.2098) --Apple-Mail=_E3F52462-6F37-409E-802E-34130319033E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, I=E2=80=99ve recently noticed that our broker log.dirs are using up = different amounts of storage. We use JBOD for our brokers, with 12 = log.dirs, 1 on each disk. One of our topics is larger than the others, = and has 12 partitions. Replication factor is 3, and we have 4 brokers. = Each broker then has to store 9 partitions for this topic (12*3/4 =3D=3D = 9). I guess I had originally assumed that Kafka would be smart enough to = spread partitions for a given topic across each of the log.dirs as = evenly as it could. However, on some brokers this one topic has 2 = partitions in a single log.dir, meaning that the storage taken up on a = single disk by this topic on those brokers is twice what it should be. e.g. Filesystem Size Used Avail Use% Mounted on /dev/sda3 1.8T 1.2T 622G 66% /var/spool/kafka/a /dev/sdb3 1.8T 1.7T 134G 93% /var/spool/kafka/b =E2=80=A6 $ du -sh /var/spool/kafka/{a,b}/data/webrequest_upload-* 501G a/data/webrequest_upload-4 500G b/data/webrequest_upload-11 501G b/data/webrequest_upload-8 This also means that those over populated disks have more writes to do. = My I/O is imbalanced! This is sort of documented at http://kafka.apache.org/documentation.html = : "If you configure multiple data directories partitions will be assigned = round-robin to data directories. Each partition will be entirely in one = of the data directories. If data is not well balanced among partitions = this can lead to load imbalance between disks.=E2=80=9D But my data is well balanced among partitions! It=E2=80=99s just that = multiple partitions are assigned to a single disk. Anyyyyyyway, on to a question: Is it possible to move partitions = between log.dirs? Is there tooling to do so? Poking around in there, = it looks like it might be as simple as shutting down the broker, moving = the partition directory, and then editing both = replication-offset-checkpoint and recovery-point-offset-checkpoint files = so that they say the appropriate things in the appropriate directories, = and then restarting broker. Someone tell me that this is a horrible idea. :) -Ao --Apple-Mail=_E3F52462-6F37-409E-802E-34130319033E--