You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by DJ Zhu <go...@gmail.com> on 2022/01/06 12:45:28 UTC

[DISCUSS] Add a system property to override Runtime.getRuntime().availableProcessors()

Hello everyone,

I deploy rocketmq in docker environment. While there are some properties
which take the number of runtime processors as default. It causes the jvm
to start up with the physical setting which is not suitable for my virtual
host.

I do know there are some ways to correct this, such as:
1. add `-XX:ActiveProcessorCount=count` to start up. But only after jdk8u191
2. upgrade jdk to jdk 11.
However, it is hard to push such an upgrade in a big company like us.

Or
3. do some code to change all the properties that refer to runtime.
It's too much work to do so and may not be suitable for different versions.

So I suggest adding an optional system property to accomplish this.

Thx.
Best regards.

Re: [DISCUSS] Add a system property to override Runtime.getRuntime().availableProcessors()

Posted by Rongtong Jin <ji...@mails.ucas.ac.cn>.
Hi DJ Zhu, If you encounter this issue on the broker side, you can directly modify the configuration file to solve it. Runtime.getRuntime().availableProcessors() is only used in broker config.

&quot;DJ Zhu&quot; &lt;gogodjzhu@gmail.com&gt;写道:
> Hello everyone,
> 
> I deploy rocketmq in docker environment. While there are some properties
> which take the number of runtime processors as default. It causes the jvm
> to start up with the physical setting which is not suitable for my virtual
> host.
> 
> I do know there are some ways to correct this, such as:
> 1. add `-XX:ActiveProcessorCount=count` to start up. But only after jdk8u191
> 2. upgrade jdk to jdk 11.
> However, it is hard to push such an upgrade in a big company like us.
> 
> Or
> 3. do some code to change all the properties that refer to runtime.
> It's too much work to do so and may not be suitable for different versions.
> 
> So I suggest adding an optional system property to accomplish this.
> 
> Thx.
> Best regards.