Solaris 容器中的 Java availableProcessors()

发布于 2024-09-16 23:31:17 字数 283 浏览 5 评论 0原文

我正在使用具有 2 个核心的 Solaris 容器(物理机有 32 个核心,每个核心有 8 个线程)来运行 jvm (BEA Jrockit)。

令人惊讶的是:Runtime.getRuntime().availableProcessors() 返回 256,而不是 2,或者说 16。也就是说,应用程序(密封产品)相信有 256 个核心可用,这可能会导致性能下降问题。

有什么方法可以限制 Solaris 容器可以看到的核心数量,或者传递给 JRockit(甚至 Sun Hotspot)吗?

I'm using a Solaris Container with 2 cores (the physical machine has 32 with 8 threads, each one) to run a jvm (BEA Jrockit).

The surprise is: Runtime.getRuntime().availableProcessors() returns 256 rather than 2 or, say 16. That is, the application (a sealed product) believe in 256 cores available, what may cause performance issues.

Are the any way to limit the number of cores a Solaris Container can see, or pass to JRockit (or even Sun Hotspot)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

镜花水月 2024-09-23 23:31:17

您可以使用:

# poolcfg -c 'create pset zone_pset ( uint pset.min=2; uint pset.max=15 )'
# poolcfg -c 'create pool zone_pool'
# poolcfg -c 'associate pool zone_pool ( pset zone_pset )'
# poolcfg -c 'modify pool zone_pool ( string pool.scheduler="FSS" )'
# pooladm -c

指定容器中 2 到 15 个核心。了解更多此处

You can use:

# poolcfg -c 'create pset zone_pset ( uint pset.min=2; uint pset.max=15 )'
# poolcfg -c 'create pool zone_pool'
# poolcfg -c 'associate pool zone_pool ( pset zone_pset )'
# poolcfg -c 'modify pool zone_pool ( string pool.scheduler="FSS" )'
# pooladm -c

to specify between 2 and 15 cores in your container. Read more here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文