Skip to content

Instantly share code, notes, and snippets.

@haisum
Created November 6, 2017 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haisum/f179ebe9a83e63780660ee7e512731b4 to your computer and use it in GitHub Desktop.
Save haisum/f179ebe9a83e63780660ee7e512731b4 to your computer and use it in GitHub Desktop.
Go memory/cpu analysis
//run two servers:
go func() {
err := proxy.Start(viper.GetString("PROXY_URL"),
viper.GetString("PROXY_SUFFIX"),
viper.GetString("DATA_DIR"),
viper.GetString("HTTP_HOST"),
viper.GetInt("HTTP_PORT"))
if err != nil {
log.WithError(err).Fatal("Error happened in starting proxy server.")
}
}()
log.Println(http.ListenAndServe(":6060", nil))
//use this for pprof:
// go tool pprof -alloc_objects goprofex http://10.74.72.64:6060/debug/pprof/heap
// top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment