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 3BCAF200D73 for ; Tue, 26 Dec 2017 17:39:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3A6B6160C00; Tue, 26 Dec 2017 16:39:32 +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 55253160C10 for ; Tue, 26 Dec 2017 17:39:31 +0100 (CET) Received: (qmail 74647 invoked by uid 500); 26 Dec 2017 16:39:30 -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 73877 invoked by uid 99); 26 Dec 2017 16:39:29 -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 16:39:29 +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 5459418066A; Tue, 26 Dec 2017 16:39:29 +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-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 XiFkCizeOueu; Tue, 26 Dec 2017 16:39:26 +0000 (UTC) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 27D245FACF; Tue, 26 Dec 2017 16:39:26 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id g80so35613349lfg.0; Tue, 26 Dec 2017 08:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:cc:from:subject:date:importance :in-reply-to:references; bh=Z4G5bKLo54rnZWyuNB9F1gzG9bOCSGlSoYQYGjPgjuU=; b=R5D8YwmvtY0JPsZqnMKD73HHm5XqlseupUuUkLO9r2cfyXkv0QseVE/E2NQArSFJGO 60dIrZpXLTsgEIBUj60087DenqnVO21ieFNSvnNpaoA8COCnXskjJnVXlVgyZkSxb9ka YncGTNqD8VVQAettt6K9qbQvx0ncjviMCTuJV4SxbmJIlfiNHXLgf+Lt+FPA3saQ0MiD xylvb+pU+PBX4vcB6YWBHA6J0ACp5vYPGN9H6Ko/Su9PlKpu4TFd19CDyy6kOjyZL0EU e1SzEXSa+qFySGYV+twEQYa5vsI3fagp1oE3qsfcuSa7BFMYA5tTd6lyhjRFCXKfgOp7 8DNg== 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:cc:from:subject:date :importance:in-reply-to:references; bh=Z4G5bKLo54rnZWyuNB9F1gzG9bOCSGlSoYQYGjPgjuU=; b=t40mE9oADYdcHsKGpzCjlho8k9rR3IspGhN1LBNvVG7tyGS+PdWMVdZE9JW/FvKEE+ kRutIjrxu4sdZ5QMZm+G3ePLlNy5kOiSy2WpgOQUTbxEO39F6Mv6ML+2fGlDyPGQcHCT FkN3F7CL4aAg4b4iwZF1euBX3e+aIZb3SqoW7/S0bZI95KBzooxY857leSIWXHWbowsN JoznErhSNUCWkQWR+ohxysQIo1ARyRXWRQ1stxjUNzD/f9WVPK2le4lsovkdbxZDJg2E iHA6nDlnGpjQnsX3ibmZNBmMF/4JotHwjDXpmMTjC7BX/xQwWISzXD7jXKxV7Yd1IzhT GIWA== X-Gm-Message-State: AKGB3mKYarypxcP/5T6LCvlMp8pKp4pctAPXFvXUleTf+gs7ZMRIalaE zxbUjp80vZaBK0bCsYl90dcnA1KR X-Google-Smtp-Source: ACJfBovsKkHwNSqvaQGVVuievIv3T6+Y4KUj4oce0Rk5adBq4bMif5OSHc18etab+t73iO2e0o3RZA== X-Received: by 10.46.68.214 with SMTP id b83mr16106110ljf.86.1514306365045; Tue, 26 Dec 2017 08:39:25 -0800 (PST) Received: from ?IPv6:::ffff:192.168.0.103? ([93.185.26.36]) by smtp.gmail.com with ESMTPSA id u81sm2552466lfg.88.2017.12.26.08.39.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Dec 2017 08:39:24 -0800 (PST) Message-ID: <5a427b3c.54dd190a.a1837.2fce@mx.google.com> MIME-Version: 1.0 To: "user@ignite.apache.org" Cc: "dev@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 19:39:24 +0300 Importance: normal X-Priority: 3 In-Reply-To: References: Content-Type: multipart/alternative; boundary="_42CBA015-8B70-4D13-B2E5-899D2C2367AC_" archived-at: Tue, 26 Dec 2017 16:39:32 -0000 --_42CBA015-8B70-4D13-B2E5-899D2C2367AC_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Arseny, Both OpenJDK and Oracle JDK 8u151 should do. I=E2=80=99ve checked and it seems that it is indeed about the specific way = of invoking Docker. By default it doesn=E2=80=99t restrict container to par= ticular CPUs, but you can make it do that by using `--cpuset-cpus` flag. Example: Without cpuset (Docker host has 4 CPUs) >docker run -it java-docker bash root@8a2cd9d06695:/usr/test# java -version openjdk version "1.8.0_151" OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2= -b12) OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) root@8a2cd9d06695:/usr/test# jjs jjs> print(java.lang.Runtime.runtime.availableProcessors()); 4 With cpuset specifying the first two CPUs >docker run -it --cpuset-cpus=3D0,1 java-docker bash root@7c2723a9819e:/usr/test# jjs jjs> print(java.lang.Runtime.runtime.availableProcessors()); 2 Note also that by using cpuset you change the settings for the whole contai= ner, not just for the Ignite, so that other Java pools in the same JVM, e.g= . parallel stream executor, should also work better. Unfortunately, I=E2=80=99m not familiar with Kubernetes, but the manual [1]= says that you can enable the use of cpusets via a static CPU management po= licy. Hope that helps, Stan [1] https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-poli= cies/ From: Arseny Kovalchuk Sent: 26 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3. 17:37 To: user@ignite.apache.org Cc: dev@ignite.apache.org Subject: Re: Runtime.availableProcessors() returns hardware's CPU count whi= chis the issue with Ignite in Kubernetes Hi Stanislav. We use OpenJDK and use Alpine Linux based images. See java version below. I= n our environment availableProcessors returns CPU's for the host.=C2=A0 Did you mean to try Oracle's JDK 8u151? arseny@kovalchuka-ubuntu:~/kipod-x$ ku exec ignite-instance-0 -ti bash bash-4.4# java -version openjdk version "1.8.0_151" OpenJDK Runtime Environment (IcedTea 3.6.0) (Alpine 8.151.12-r0) OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) bash-4.4# jjs jjs> print(java.lang.Runtime.runtime.availableProcessors()); 40 jjs>=C2=A0 =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 On 26 December 2017 at 16:56, Yakov Zhdanov wrote: Ilya, agree. I like IGNITE_AVAILABLE_CPU more. Yakov Zhdanov, www.gridgain.com 2017-12-26 16:36 GMT+03:00 Ilya Lantukh : Hi Yakov, I think that property IGNITE_NODES_PER_HOST, as you suggested, would be con= fusing, because users might want to reduce amount of available resources fo= r ignite node not only because they run multiple nodes per host, but also b= ecause they run other software. Also, in my opinion all types of system res= ources (CPU, memory, network) shouldn't be scaled using the same value. So I'd prefer to have IGNITE_CONCURRENCY_LEVEL or IGNITE_AVAILABLE_PROCESSO= RS, as it was originally suggested. On Tue, Dec 26, 2017 at 4:05 PM, Yakov Zhdanov wrote: 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 > --=20 Best regards, Ilya --_42CBA015-8B70-4D13-B2E5-899D2C2367AC_--