3 ms·
Prior to Go 1.5 the default of 1 made sense for most typical Go programs, but I know of many users who set the variable differently for better performance. Dat
by enneff 11y ago
Prior to Go 1.5 the default of 1 made sense for most typical Go programs, but I know of many users who set the variable differently for better performance.
Data point: Inside Google we have been setting GOMAXPROCS=runtime.NumCPU for many years because most of the Go programs we run are highly concurrent network servers, for which a higher GOMAXPROCS value gives better performance.
- hedgehog 11y agoInteresting, can you share much about the other work on the same machine? In particular I'm curious if there are many other services running no those machines. I've written some services in Go (thanks!) but actually left GOMAXPROCS at 1 because there were other components running as separate processes on the same hosts.
- enneff 11y agoSome machines run many other jobs, some machines run few. It depends on the resource allocation.
- zaphar 11y agoWhen I was at Google the machines where typically oversubscribed and the workload varied quite a bit. Google has done a lot of work to allow you to ignore the other processes on the machine and just specify the resources your process required. Then Borg which they recently published a paper about would take care of scheduling it on an appropriate machine. As a consequence, answering the question of what other processes where on the same machine was not as easy as on an EC2 instance. We didn't mind though because Borg was so good at scheduling we pretty much didn't have to care about the machine level. Instead we thought at the datacenter level.
- acdha 11y agoI think 1 was fine for many people but I wish it'd been 2 simply to avoid people getting as far before realizing there was a class of problem they weren't testing.