Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6875F200CCB for ; Thu, 20 Jul 2017 21:07:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 66BB416BE99; Thu, 20 Jul 2017 19:07:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 861A716BE96 for ; Thu, 20 Jul 2017 21:06:59 +0200 (CEST) Received: (qmail 17099 invoked by uid 500); 20 Jul 2017 19:06:55 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 16989 invoked by uid 99); 20 Jul 2017 19:06:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2017 19:06:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2515B18056F for ; Thu, 20 Jul 2017 19:06:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.089 X-Spam-Level: *** X-Spam-Status: No, score=3.089 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_IMAGE_RATIO_04=0.61, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=confluent-io.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id bp67cfOzVd8X for ; Thu, 20 Jul 2017 19:06:51 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id F39B75FC3D for ; Thu, 20 Jul 2017 19:06:50 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id w191so35055859wmw.1 for ; Thu, 20 Jul 2017 12:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=confluent-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+duWyTE0gcveLd80IUjyq4t5QMyM32YKAq8C3GYwakY=; b=x5zsVFpdcHkSv6cLLpdvgGnG9loUfzGmaY7VmaHKtavy3vaQkit/H7GQ0iwKaQ0/IX op7zFonY2V7/iA0Xavjd0bWJZMLr+iV+LcWODzSCqW+xLWV5Pwp94IcUSakWltgAiGeB 2GYy1WQWBmRpHeSreCS5AwYFLHIRn5Aq+eYJD6FU4ix4l5NZnGYMCVlS5AXM8rWZgmDK cuXD9CzxZ36p68SrrNK/ZkIgOipX/eZuCM5nJkNizR+ejwc9K6AlfYg74CX7XidJ+eqx tQcgV3lZxz9MQTvbuh5O8mH5YSLUDAYSnvrJwDLf9QeKvftfoV2PwlEy9UhwJwZPvFsS Yfag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+duWyTE0gcveLd80IUjyq4t5QMyM32YKAq8C3GYwakY=; b=kzRbXw737TdA4OOikEcRe5VVHIwtPgS8zvaQZOBQjau+vzO2l1d0AosTwOrgBR4GW6 Gp/NCPVmEZThOlAHcG30dB7E/HCOSKiDVbWnKyqy+VCAOPydYpTzgjmILGaLwx0Kjktd RYFQvX4HHW8lMl6KCZOt2xgB+K0k2Qvtln8Ffe0UKWC6hvmymwjcRhi2gCY9FeilZ9lk RuapKE8oIe63bwza6UQz6P92mZadjAJhvBwoQOUyvHF0WiQsim019Jw6AKiaX5HYJoKb kCMkW0+xG7wLryjM1mzdTFqC++VWAYlWiDmqG27wkPiIClSgJBEQ0nDxvC5r5lMRfLlE c5jg== X-Gm-Message-State: AIVw112Typu9XlxDdxHPCC0IWSiA7QRkadOKn8w8gRvBQ7u7Pwjga8qL 8PMCVQrhA9x2tKRW X-Received: by 10.28.183.196 with SMTP id h187mr2985683wmf.134.1500577610470; Thu, 20 Jul 2017 12:06:50 -0700 (PDT) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com. [74.125.82.44]) by smtp.gmail.com with ESMTPSA id 49sm8518210wrv.23.2017.07.20.12.06.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 12:06:49 -0700 (PDT) Received: by mail-wm0-f44.google.com with SMTP id v139so3065327wmv.0; Thu, 20 Jul 2017 12:06:48 -0700 (PDT) X-Received: by 10.28.5.19 with SMTP id 19mr3008482wmf.20.1500577608752; Thu, 20 Jul 2017 12:06:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.67.68 with HTTP; Thu, 20 Jul 2017 12:06:47 -0700 (PDT) In-Reply-To: <76A7B822-1DEB-4593-A639-C70FF887137A@inria.fr> References: <76A7B822-1DEB-4593-A639-C70FF887137A@inria.fr> From: Jay Kreps Date: Thu, 20 Jul 2017 12:06:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Consumer throughput drop To: "users@kafka.apache.org" Cc: "dev@kafka.apache.org" , Ovidiu Cristian Marcu Content-Type: multipart/related; boundary="001a1144377e5447900554c4736a" archived-at: Thu, 20 Jul 2017 19:07:00 -0000 --001a1144377e5447900554c4736a Content-Type: multipart/alternative; boundary="001a1144377e54478d0554c47369" --001a1144377e54478d0554c47369 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I suspect this is on Linux right? The way Linux works is it uses a percent of memory to buffer new writes, at a certain point it thinks it has too much buffered data and it gives high priority to writing that out. The good news about this is that the writes are very linear, well layed out, and high-throughput. The problem is that it leads to a bit of see-saw behavior. Now obviously the drop in performance isn't wrong. When your disk is writing data out it is doing work and obviously the read throughput will be higher when you are just reading and not writing then when you are doing both reading and writing simultaneously. So obviously you can't get the no-writing performance when you are also writing (unless you add I/O capacity). But still these big see-saws in performance are not ideal. You'd rather have more constant performance all the time rather than have linux bounce back and forth from writing nothing and then frantically writing full bore. Fortunately linux provides a set of pagecache tuning parameters that let you control this a bit. I think these docs cover some of the parameters: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/ht= ml/Performance_Tuning_Guide/s-memory-tunables.html -Jay On Thu, Jul 20, 2017 at 10:24 AM, Ovidiu-Cristian MARCU < ovidiu-cristian.marcu@inria.fr> wrote: > Hi guys, > > I=E2=80=99m relatively new to Kafka=E2=80=99s world. I have an issue I de= scribe below, > maybe you can help me understand this behaviour. > > I=E2=80=99m running a benchmark using the following setup: one producer s= ends data > to a topic and concurrently one consumer pulls and writes it to another > topic. > Measuring the consumer throughput, I observe values around 500K records/s > only until the system=E2=80=99s cache gets filled - from this moment the = consumer > throughout drops to ~200K (2.5 times lower). > Looking at disk usage, I observe disk read I/O which corresponds to the > moment the consumer throughout drops. > After some time, I kill the producer and immediately I observe the > consumer throughput goes up to initial values ~ 500K records/s. > > What can I do to avoid this throughput drop? > > Attached an image showing disk I/O and CPU usage. I have about 128GB RAM > on that server which gets filled at time ~2300. > > Thanks, > Ovidiu > > --001a1144377e54478d0554c47369 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I suspect this is on Linux right?

The w= ay Linux works is it uses a percent of memory to buffer new writes, at a ce= rtain point it thinks it has too much buffered data and it gives high prior= ity to writing that out. The good news about this is that the writes are ve= ry linear, well layed out, and high-throughput. The problem is that it lead= s to a bit of see-saw behavior.

Now obviously the = drop in performance isn't wrong. When your disk is writing data out it = is doing work and obviously the read throughput will be higher when you are= just reading and not writing then when you are doing both reading and writ= ing simultaneously. So obviously you can't get the no-writing performan= ce when you are also writing (unless you add I/O capacity).

<= /div>
But still these big see-saws in performance are not ideal. You= 9;d rather have more constant performance all the time rather than have lin= ux bounce back and forth from writing nothing and then frantically writing = full bore. Fortunately linux provides a set of pagecache tuning parameters = that let you control this a bit.=C2=A0

I think the= se docs cover some of the parameters:

-Jay

On Thu, Jul 20, 2017 at 10:24 A= M, Ovidiu-Cristian MARCU <ovidiu-cristian.marcu@inria.fr&= gt; wrote:
Hi guys,

I=E2=80=99m relatively new to Kafk= a=E2=80=99s world. I have an issue I describe below, maybe you can help me = understand this behaviour.

I=E2=80=99m running a b= enchmark using the following setup: one producer sends data to a topic and = concurrently one consumer pulls and writes it to another topic.
M= easuring the consumer throughput, I observe values around 500K records/s on= ly until the system=E2=80=99s cache gets filled - from this moment the cons= umer throughout drops to ~200K (2.5 times lower).
Looking at disk= usage, I observe disk read I/O which corresponds to the moment the consume= r throughout drops.
After some time, I kill the producer and imme= diately I observe the consumer throughput goes up to initial values ~ 500K = records/s.

What can I do to avoid this throughput = drop?

Attached an image showing disk I/O and CPU u= sage. I have about 128GB RAM on that server which gets filled at time ~2300= .

Thanks,
Ovidiu


--001a1144377e54478d0554c47369-- --001a1144377e5447900554c4736a--