You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/12/04 00:34:55 UTC

[GitHub] [dubbo-go-pixiu] ztelur opened a new issue #313: k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数

ztelur opened a new issue #313:
URL: https://github.com/apache/dubbo-go-pixiu/issues/313


   <!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
   
   -->
   https://github.com/apache/dubbo-go-pixiu/blob/develop/cmd/pixiu/pixiu.go#L151
   
   这里是不是有点问题. 在 k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数. 会导致调度不合理延迟加大.
   
   from others


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] ztelur commented on issue #313: k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数

Posted by GitBox <gi...@apache.org>.
ztelur commented on issue #313:
URL: https://github.com/apache/dubbo-go-pixiu/issues/313#issuecomment-989854886


   It seems that gopsutil doesn't work well in k8s too. stackoverflow answer recommand https://github.com/uber-go/automaxprocs. 
   ```
   import _ "go.uber.org/automaxprocs"
   
   func main() {
     // Your application logic here.
   }
   ```
   pixiu code is like below
   
   ```
   	if limitCpuNumber <= 0 {
   		runtime.GOMAXPROCS(runtime.NumCPU())
   	} else {
   		runtime.GOMAXPROCS(int(limitCpuNumber))
   	}
   ```
   Do we need assign limitCpuNumber by command argument ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] AlexStocks commented on issue #313: k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on issue #313:
URL: https://github.com/apache/dubbo-go-pixiu/issues/313#issuecomment-985944770


   github.com/shirou/gopsutil v3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] liu-song commented on issue #313: k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数

Posted by GitBox <gi...@apache.org>.
liu-song commented on issue #313:
URL: https://github.com/apache/dubbo-go-pixiu/issues/313#issuecomment-989893817


   More recommended  use go.uber.org/automaxprocs  which  automatically set GOMAXPROCS according to linux container quota。https://github.com/shirou/gopsutil/blob/master/cpu/cpu.go#L64   which  returns the number of physical  can't fix this. go.uber.org/automaxprocs has been used in dapr ,jaeger to fix the same bug.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go-pixiu] ztelur closed issue #313: k8s 集群内部署的话直接用NumCPU()获取不到真实可用核心数

Posted by GitBox <gi...@apache.org>.
ztelur closed issue #313:
URL: https://github.com/apache/dubbo-go-pixiu/issues/313


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org