software:postgres_stack_traces
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| software:postgres_stack_traces [2025/10/23 01:05] – [Postgres Stack Traces] timb | software:postgres_stack_traces [2025/10/23 01:10] (current) – timb | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| Attached are annotated examples of: | Attached are annotated examples of: | ||
| - | * how to capture stack traces using the helper script | + | * how to capture stack traces using the helper script |
| - | * a few tips on finding useful facts in the stack traces | + | * a few tips on finding useful facts in the stack traces |
| - | == How to Capture == | + | ==== How to Capture |
| < | < | ||
| Line 20: | Line 20: | ||
| </ | </ | ||
| - | == How to Analyze == | + | ==== How to Analyze |
| - | * For reference, the output files are usually ~100-1000 KB. | + | * For reference, the output files are usually ~100-1000 KB. |
| < | < | ||
| Line 59: | Line 59: | ||
| * There are currently 2 helper scripts to simplify and filter the stacks. | * There are currently 2 helper scripts to simplify and filter the stacks. | ||
| - | * ``stack_trace_filter.simplify_frames.pl`` | + | * ``stack_trace_filter.simplify_frames.pl`` |
| * Strips out all arguments from the function. | * Strips out all arguments from the function. | ||
| Line 65: | Line 65: | ||
| * Will consolidate at some point in the future. | * Will consolidate at some point in the future. | ||
| - | * ``stack_trace_filter.regexp_match_on_whole_stack.pl`` | + | * ``stack_trace_filter.regexp_match_on_whole_stack.pl`` |
| * Show whole stack if any frame matches the given perl regexp. | * Show whole stack if any frame matches the given perl regexp. | ||
| Line 72: | Line 72: | ||
| < | < | ||
| - | |||
| [postgres@db04.prd ~]$ ls -l ~/ | [postgres@db04.prd ~]$ ls -l ~/ | ||
| -rwxr-xr-x. 1 postgres postgres 347 Jan 10 18:24 / | -rwxr-xr-x. 1 postgres postgres 347 Jan 10 18:24 / | ||
| -rwxr-xr-x. 1 postgres postgres 117 Jan 10 22:27 / | -rwxr-xr-x. 1 postgres postgres 117 Jan 10 22:27 / | ||
| - | |||
| </ | </ | ||
| - | * Examples: | + | * Examples: |
| - | * Review each stack individually, | + | * Review each stack individually, |
| < | < | ||
| - | |||
| [postgres@db04.prd ~]$ cat / | [postgres@db04.prd ~]$ cat / | ||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ||
| Line 190: | Line 187: | ||
| </ | </ | ||
| - | * Aggregate frames from all stacks. | + | * Aggregate frames from all stacks. |
| - | * This is helpful for seeing what are the most common frames among all the stacks. | + | * This is helpful for seeing what are the most common frames among all the stacks. |
| - | * Particularly helpful for: | + | * Particularly helpful for: |
| - | * Finding where a single process is spending most of its time, by capturing its stack multiple times during a single query or session, and aggregating the stack traces. | + | * Finding where a single process is spending most of its time, by capturing its stack multiple times during a single query or session, and aggregating the stack traces. |
| - | * Note that a function may appear in different frame numbers, depending on when the process was interrupted. | + | * Note that a function may appear in different frame numbers, depending on when the process was interrupted. |
| - | * The same trick can be used on many processes if they are doing the same thing (e.g. all testtaker sessions behave similarly). | + | * The same trick can be used on many processes if they are doing the same thing (e.g. all testtaker sessions behave similarly). |
| - | * Interpreting system-call traces (strace). | + | |
| < | < | ||
| + | . | ||
| [postgres@db04.prd ~]$ cat / | [postgres@db04.prd ~]$ cat / | ||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ||
software/postgres_stack_traces.1761181531.txt.gz · Last modified: by timb
