-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Draft: Performance mega boost - queue per app #1990
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Generate a timestamp | ||
timestamp=$(date +%Y-%m-%d_%H-%M-%S) | ||
|
||
# Function to fetch goroutine profile | ||
fetch_goroutine_profile() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this script used anywhere? Couldn't find the references or docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script is used for manual profiling which we've added as part of this feature (disabled by default). I probably need to add some documenting on how to use it |
||
local profile_type=$1 # 'start' or 'end' | ||
local profile_path="/tmp/goroutine-profile-debug1-$profile_type-$timestamp.prof" | ||
echo "Starting to fetch Goroutine profile ($profile_type) at $(date)..." | ||
curl "http://localhost:6060/debug/pprof/goroutine?debug=1" -o "$profile_path" | ||
echo "Completed fetching Goroutine profile ($profile_type) at $(date). File saved to $profile_path" | ||
} | ||
|
||
echo "Starting to fetch CPU profile at $(date)..." | ||
cpu_profile="/tmp/cpu-profile-30sec-$timestamp.prof" | ||
curl "http://localhost:6060/debug/pprof/profile?seconds=30" -o "$cpu_profile" & | ||
echo "CPU profile fetch initiated, running for 30 seconds..." | ||
|
||
echo "Starting to fetch Trace profile at $(date)..." | ||
trace_profile="/tmp/trace-profile-30sec-$timestamp.prof" | ||
curl "http://localhost:6060/debug/pprof/trace?seconds=30" -o "$trace_profile" & | ||
echo "Trace profile fetch initiated, running for 30 seconds..." | ||
|
||
echo "Fetching initial Goroutine profile..." | ||
fetch_goroutine_profile "start" & | ||
|
||
# Wait for CPU and trace profiling to complete | ||
wait | ||
|
||
echo "Starting to fetch final Goroutine profile after waiting for other profiles to complete..." | ||
fetch_goroutine_profile "end" | ||
|
||
echo "All profiling data collected" | ||
|
||
# Copying profiles to S3 bucket | ||
echo "CPU profile output - $cpu_profile" | ||
echo "Trace profile output - $trace_profile" | ||
echo "Initial Goroutine profile output - /tmp/goroutine-profile-debug1-start-$timestamp.prof" | ||
echo "Final Goroutine profile output - /tmp/goroutine-profile-debug1-end-$timestamp.prof" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make these two values configurable? Would there be a possibility for users to modify these values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I will