-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bake in pprof data from production to optimise hot paths
This data was collected by setting `COLLECT_METRICS=yes` on production and then running: ```bash $ while true; do curl http://localhost:6060/debug/pprof/profile?seconds=30 --output profiles/$(date +%s).pprof; sleep 270; done ``` To gather a chunk of metrics every 5 mins for 30 seconds for a couple of hours. The traffic to the server came in bursts, but included lots of visits to jupyter- which is massively asset heavy and makes loads of calls to /api/v1/auth. At some point we can start thinking about gathering data from loads of instances over many days with lots of requests; at that point this commit will be useful prep
- Loading branch information
Showing
5 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
littleauth | ||
profiles/*.pprof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package main | ||
|
||
import ( | ||
"net/http" | ||
_ "net/http/pprof" //#nosec: G108 | ||
"os" | ||
) | ||
|
||
func init() { | ||
go func() { | ||
if os.Getenv("COLLECT_METRICS") == "yes" { | ||
//#nosec: G114 | ||
print(http.ListenAndServe("localhost:6060", nil), "\n") | ||
} | ||
}() | ||
} |
Empty file.