Go1.11.5 compiled program makes cpu 100% in runtime

Environment: windows 2016 Server + IIS (8 processes) + golang 1.11.5
Program:

package main
import "fmt"
func main(){
  fmt.println("hello, golang")
}
# go build -o hello.exe hello.go

result: run the program, it makes iis cpu percent reaches 100%. while in other environment the program works well.

Note: when the number of iis working process <= 4, hello.exe runs well。when > 4, hello.exe makes iis processes take 100% cpu.

I’m pretty sure that is a very strange situation like rising at 100% a server with a Hello World program. A point of start could be checking the GOARCH and the right Go compiler version (probably should be amd64).

How did you compile and run the program? Was it through cmd.com or PowerShell? Or did you use an IDE?

If you haven’t tried it yet, run the compiler directly from the command line (as with go build hello.go) rather than through an IDE.

And you can have an even simpler Go program:

package main
func main() {}

which does nothing when run.

I checked the environment,GOARCH is amd64. not only go1.11.5 but also other versions, such as go1.8.7, go1.9.7, etc,also has this problem.

I compile it through cmd. the command is

go build -o hello.exe hello.go

hello.exe can works well in all other windows. Only in windows server 2016 + IIS, it encounters the problem.

If this happen probably a good idea is to report this issue to the developers to see their point of view. Follow this link for this.

OK, thx

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.