[ 
https://issues.apache.org/jira/browse/BEAM-10222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148939#comment-17148939
 ] 

Adam Verigin edited comment on BEAM-10222 at 6/30/20, 8:21 PM:
---------------------------------------------------------------

If I inspect a Dataflow worker container (via {{docker container inspect}}), I 
see it has the following settings:
{noformat}
            "CpuShares": 2,
            "CpuPeriod": 100000,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",{noformat}
The important pieces being CpuQuota and CpuShares.

If you add --cpu-shares=2 and --cpu-quota=0 to your run command, you should see 
the available processor count drop to 1.


was (Author: averigin):
If I inspect a Dataflow worker container (via {{docker container inspect}}), I 
see it has the following settings:
{noformat}
            "CpuShares": 2,
            "CpuPeriod": 100000,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",{noformat}
The important pieces being CpuQuota and CpuShares.

If you add {{--cpu-shares=2}} and {{--cpu-quota=0}} to your run command, you 
should see the available processor count drop to 1.

> Java11 only detects 1 CPU when running on Dataflow
> --------------------------------------------------
>
>                 Key: BEAM-10222
>                 URL: https://issues.apache.org/jira/browse/BEAM-10222
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Mikhail Gryzykhin
>            Priority: P2
>
> When specifying the worker-type as "n1-highcpu-4" the resulting thread number 
> is 4 when the pipeline is compiled by Java8, and only 1 when the pipeline is 
> compiled by Java11.
> Specifying numberOfWorkerHarnessThreads does not change amount of detected 
> threads.
> Amount of available CPUs is received via 
> "Runtime.getRuntime().availableProcessors()"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to