GOMAXPROCS?

166 views
Skip to first unread message

Robert Engels

unread,
Aug 12, 2024, 9:18:00 AM8/12/24
to golang-nuts
Hi,


Is it still the case that high disk IO throughput requires a GOMAXPROCS seething higher than the number of cpus on the system?

Are there any other cases where this might be required?

Thanks. 

Ian Lance Taylor

unread,
Aug 12, 2024, 2:13:54 PM8/12/24
to Robert Engels, golang-nuts
On Mon, Aug 12, 2024 at 6:17 AM Robert Engels <ren...@ix.netcom.com> wrote:
>
> Revisiting an old thread https://groups.google.com/g/golang-nuts/c/jPb_h3TvlKE/m/qdoHhxXeAwAJ
>
> Is it still the case that high disk IO throughput requires a GOMAXPROCS seething higher than the number of cpus on the system?

It's true that we don't use the poller for local file operations on
most systems. So if your program is overloading the file system, it
is possible for goroutines to be delayed waiting for file I/O to
finish. Those delays won't be for long, as the scheduler will step in
and start new threads as needed. However, it won't do that right
away; I think the delay can be up to 10ms. In such a case it can be
useful to increase GOMAXPROCS to permit queuing up more file I/O more
quickly, or to do other non-I/O related activity.

> Are there any other cases where this might be required?

Not that I'm aware of.

Ian

robert engels

unread,
Aug 12, 2024, 5:02:50 PM8/12/24
to Ian Lance Taylor, golang-nuts
Thanks.
Reply all
Reply to author
Forward
0 new messages