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 B0926200D57 for ; Mon, 11 Dec 2017 15:24:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AF6AA160C10; Mon, 11 Dec 2017 14:24:06 +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 CEA40160C13 for ; Mon, 11 Dec 2017 15:24:05 +0100 (CET) Received: (qmail 20208 invoked by uid 500); 11 Dec 2017 14:24:05 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 20197 invoked by uid 99); 11 Dec 2017 14:24:05 -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; Mon, 11 Dec 2017 14:24:05 +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 950041806DA for ; Mon, 11 Dec 2017 14:24:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled 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 o7fy71O4guRw for ; Mon, 11 Dec 2017 14:24:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 636985FBD3 for ; Mon, 11 Dec 2017 14:24:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 84DD7E0F1F for ; Mon, 11 Dec 2017 14:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id F3726212FA for ; Mon, 11 Dec 2017 14:24:00 +0000 (UTC) Date: Mon, 11 Dec 2017 14:24:00 +0000 (UTC) From: "Alex Dunayevsky (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (KAFKA-6343) OOM as the result of creation of 5k topics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 11 Dec 2017 14:24:06 -0000 [ https://issues.apache.org/jira/browse/KAFKA-6343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285968#comment-16285968 ] Alex Dunayevsky edited comment on KAFKA-6343 at 12/11/17 2:23 PM: ------------------------------------------------------------------ Ismael Juma, once again, thank you! This time it looks like the core problem. Reproducing: {code:java} // Max number memory map operations is: $ /sbin/sysctl vm.max_map_count vm.max_map_count = 65530 // Tracking vm map size: $ cat /proc//maps | wc -l 898 <--- grows from this value ... 65532 <--- up to this value (it's even a bit larger than m.max_map=65530). This is the point where broker fails... So you are right! // Then all we have to do is to increase vm.max_map size to a larger value (ex., by 65536 * 4): $ /sbin/sysctl -w vm.max_map=262144 {code} Ismael, awesome job! was (Author: alex.dunayevsky): Ismael Juma, once again, thank you! This time it looks like the core problem. *Reproducing: * {code:java} // vm.max_map_count is: $ /sbin/sysctl vm.max_map_count vm.max_map_count = 65530 // Tracking vm map size: $ cat /proc//maps | wc -l 898 <--- grows from this value ... 65532 <--- up to this value (it's even a bit larger than m.max_map=65530). This is the point where broker fails... So you are right! Then all we have to do is to increase vm.max_map size to a larger value (ex., by 65536 * 4): $ /sbin/sysctl -w vm.max_map=262144 {code} Ismael, awesome job! > OOM as the result of creation of 5k topics > ------------------------------------------ > > Key: KAFKA-6343 > URL: https://issues.apache.org/jira/browse/KAFKA-6343 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.10.1.1 > Environment: RHEL 7, RAM 755GB per host > Reporter: Alex Dunayevsky > > *Reproducing*: Create 5k topics *from the code* quickly, without any delays. Wait until brokers will finish loading them. This will actually never happen, since all brokers will go down one by one after approx 10-15 minutes or more, depending on the hardware. > *Heap*: -Xmx/Xms: 5G, 10G, 50G, 256G > > *Topology*: 3 brokers, 3 zk. > *Code for 5k topic creation:* > {code:java} > package kafka > import kafka.admin.AdminUtils > import kafka.utils.{Logging, ZkUtils} > object TestCreateTopics extends App with Logging { > val zkConnect = "grid978:2185" > var zkUtils = ZkUtils(zkConnect, 6000, 6000, isZkSecurityEnabled = false) > for (topic <- 1 to 5000) { > AdminUtils.createTopic( > topic = s"${topic.toString}", > partitions = 10, > replicationFactor = 2, > zkUtils = zkUtils > ) > logger.info(s"Created topic ${topic.toString}") > } > } > {code} > *Cause of death:* > {code:java} > java.io.IOException: Map failed > at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:920) > at kafka.log.AbstractIndex.(AbstractIndex.scala:61) > at kafka.log.OffsetIndex.(OffsetIndex.scala:52) > at kafka.log.LogSegment.(LogSegment.scala:67) > at kafka.log.Log.loadSegments(Log.scala:255) > at kafka.log.Log.(Log.scala:108) > at kafka.log.LogManager.createLog(LogManager.scala:362) > at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:94) > at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$2.apply(Partition.scala:174) > at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$2.apply(Partition.scala:174) > at scala.collection.mutable.HashSet.foreach(HashSet.scala:78) > at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:174) > at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:168) > at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:234) > at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:242) > at kafka.cluster.Partition.makeLeader(Partition.scala:168) > at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:758) > at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:757) > at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99) > at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99) > at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230) > at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40) > at scala.collection.mutable.HashMap.foreach(HashMap.scala:99) > at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:757) > at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:703) > at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:148) > at kafka.server.KafkaApis.handle(KafkaApis.scala:82) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.OutOfMemoryError: Map failed > at sun.nio.ch.FileChannelImpl.map0(Native Method) > at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:917) > ... 28 more > {code} > Broker restart results the same OOM issues. All brokers will not be able to start again. -- This message was sent by Atlassian JIRA (v6.4.14#64029)