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 BE7AA200D73 for ; Tue, 26 Dec 2017 14:30:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BD31D160C00; Tue, 26 Dec 2017 13:30:51 +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 D8C60160C10 for ; Tue, 26 Dec 2017 14:30:50 +0100 (CET) Received: (qmail 31133 invoked by uid 500); 26 Dec 2017 13:30:49 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 30384 invoked by uid 99); 26 Dec 2017 13:30:49 -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; Tue, 26 Dec 2017 13:30:49 +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 DBC4E180694; Tue, 26 Dec 2017 13:30:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id d6wXC34OUfkR; Tue, 26 Dec 2017 13:30:47 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id BD9425F3CE; Tue, 26 Dec 2017 13:30:46 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id u84so19671045lff.7; Tue, 26 Dec 2017 05:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=9Fzd03PWmgs0lshVRk+tzli/ZiGG0fsglCDMJuqjOQY=; b=E8swnWsbpUy5nhFMwQ3Ln15tZJVYk/JgDR9IgP42QwQUUS4laXg8vHhoh/xNvnZPyB rJhgey6iwqfwkpUeBjC7p+HH3RCIlLZafycpQ4Zo6l/u0Ps3DwAC7wcW+wfchWX8g72k xXH7E8ZwJZU8HVCuO9hdaTEGNMxKfkpku6CLUVZ6D3/8TDu+Gjy97g6E4wZLtpX9QKmn 348s5O72iU9T/UCUDo7pExTo7Tc4vbf1r/QfEO9SR/QTcu0xGbFKpYpMc6bwRUjCdzdt qj9ejLv4l46J0nD5rW7WWpzQ1vg25WsaKE2X9hGqYr84VYt1gwmNG7ZkNaOytq6qdJiO os3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=9Fzd03PWmgs0lshVRk+tzli/ZiGG0fsglCDMJuqjOQY=; b=OP92av65O2LEjKm3uZQguLDQsgGq3HplKkP7tn4RfSgPGCwepD4p/DpDjIwdDyztua 1aSmp5B0aexDuq9eDSbIUR4RTnn4cTPyqfyaKeNMIZGjDOjg1tX4/MhnTLPdD1TI1buG KhMgz1uRI1fBFWYKvRc1tWxqipM++VUZQXW9ysGn8Ii2eO/SPsLipsOGUP2th50XKjx3 S2pWO1O7cnKcR8GYrfo8+oKt5yT4fLjs4lVk0DCq2Y3vav0aetmwpdFfed+aMRgnEBzw 1uiayde1pRKgsvU9Et0ol6ct4Pp9TG7JlDxqJE3zRaKrYyj5+YdC3a778tUWrkLZK9SR yvmw== X-Gm-Message-State: AKGB3mLjdNk7lD5aRYEW3Qgpqp0OJBVKl6lZFusfaof/kTpnunYuLp26 QvHjk8jJtuAIZ7fOcq9dTrdIvNaD X-Google-Smtp-Source: ACJfBouuRb0hX01pv5q/8rkuo4sjSoDxCCGgiJrQWnYirLxTvp+YhEnqwX2oZf1+npANsuyVB3Ik/g== X-Received: by 10.25.21.101 with SMTP id l98mr14892908lfi.134.1514295038921; Tue, 26 Dec 2017 05:30:38 -0800 (PST) Received: from ?IPv6:::ffff:192.168.0.103? ([93.185.26.36]) by smtp.gmail.com with ESMTPSA id e23sm3054810lfi.92.2017.12.26.05.30.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Dec 2017 05:30:38 -0800 (PST) Message-ID: <5a424efe.170f190a.e630d.6a70@mx.google.com> MIME-Version: 1.0 To: "dev@ignite.apache.org" , "user@ignite.apache.org" From: Stanislav Lukyanov Subject: RE: Runtime.availableProcessors() returns hardware's CPU count whichis the issue with Ignite in Kubernetes Date: Tue, 26 Dec 2017 16:30:38 +0300 Importance: normal X-Priority: 3 In-Reply-To: References: Content-Type: multipart/alternative; boundary="_3C8E4489-3650-490C-A5D0-52A75BF4318A_" archived-at: Tue, 26 Dec 2017 13:30:51 -0000 --_3C8E4489-3650-490C-A5D0-52A75BF4318A_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Arseny, This behavior of the `Runtime.availableProcessors()` is actually a recogniz= ed issue of the Hotspot, see [1]. It was fixed not that long ago for JDK 9 = and 8uX, and I can see correct values returned in my Docker environment wit= h JDK 8u151, although I believe it depends on a specific way a container is= configured. Which Java version do you use? Can you try your code on JDK 8u151? BTW see also [2] and [3] on more stuff to be fixed in JDK for better contai= ner support. Thanks, Stan [1] https://bugs.openjdk.java.net/browse/JDK-6515172 [2] https://bugs.openjdk.java.net/browse/JDK-8146115 [3] https://bugs.openjdk.java.net/browse/JDK-8182070 From: Yakov Zhdanov Sent: 26 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3. 16:05 To: user@ignite.apache.org; dev@ignite.apache.org Subject: Re: Runtime.availableProcessors() returns hardware's CPU count whi= chis the issue with Ignite in Kubernetes Cross-posting to dev list. Guys, Suggestion below makes sense to me. Filed a ticket https://issues.apache.org/jira/browse/IGNITE-7310 Perhaps, Arseny would like to provide a PR himself ;) --Yakov 2017-12-26 14:32 GMT+03:00 Arseny Kovalchuk : > Hi guys. > > Ignite configures all thread pools, selectors, etc. basing on Runtime.ava= ilableProcessors() > which seems not correct in containerized environment. In Kubernetes with > Docker that method returns CPU count of a Node/machine, which is 64 in ou= r > particular case. But those 64 CPU and their timings are shared between > other stuff on the node like other Pods and services. Appropriate value o= f > available cores for Pod is usually configured as CPU Resource and estimat= ed > basing on different things taking performance into account. General idea, > if you want to run several Pods on the same node, they all should request > less resources then the node provides. So, we give 4-8 cores for Ignite > instance in Kubernetes, but Ignite's thread pools are configured like the= y > get all 64 CPUs, and in turn we get a lot of threads for the Pod with 4-8 > cores available. > > Now we manually set appropriate values for all available properties which > relate to thread pools. > > Would it be correct to have one environment variable, say > IGNITE_CONCURRENCY_LEVEL which will be used as a reference value for thos= e > configurations and by default equals to Runtime.availableProcessors()? > > Thanks. > > =E2=80=8B > Arseny Kovalchuk > > Senior Software Engineer at Synesis > skype: arseny.kovalchuk > mobile: +375 (29) 666-16-16 > =E2=80=8BLinkedIn Profile = =E2=80=8B > --_3C8E4489-3650-490C-A5D0-52A75BF4318A_--