Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU utilization - 100% - 120% #4168

Open
NayabChauhan opened this issue Feb 28, 2025 · 2 comments
Open

High CPU utilization - 100% - 120% #4168

NayabChauhan opened this issue Feb 28, 2025 · 2 comments

Comments

@NayabChauhan
Copy link

Hello,

We are using Gin for our project. However, without adding any additional routes or configurations—just starting the Gin server with the following setup—we are encountering an issue.

runtime.GOMAXPROCS(runtime.NumCPU())
	router := gin.New()
	router.Use(gzip.Gzip(gzip.DefaultCompression))
	err := router.RunTLS(fmt.Sprintf("%s:%s", viper.GetString("server.Ip"), viper.GetString("server.Port")), globalConfiguration.EnvConfig.HttpsConfigParams.ServerCertificatePath, globalConfiguration.EnvConfig.HttpsConfigParams.PrivateKeyPath)
	if err != nil {
		log.Fatal(router.Run(fmt.Sprintf("RunTLS error: %s", err.Error())))
	}

Please find attached screenshot for cpu utilization.

Image

@AmiZya
Copy link

AmiZya commented Mar 2, 2025

Try to run a profiler on your program and see which part is consuming too much CPU, check this link: https://go.dev/blog/pprof

@NayabChauhan
Copy link
Author

Try to run a profiler on your program and see which part is consuming too much CPU, check this link: https://go.dev/blog/pprof

thanks @AmiZya but i did run profiler and there is nothing that I found. Thats a reason only have above code in my program and still High CPU, so is it some configuration I am missing coz tried all like "COMPRESSION" changes and runtime CPU and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants