-
Notifications
You must be signed in to change notification settings - Fork 468
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
DOC-12277 Add contention examples using crdb_internal.transaction_contention_events #19377
base: main
Are you sure you want to change the base?
Conversation
Files changed:
|
✅ Deploy Preview for cockroachdb-interactivetutorials-docs canceled.
|
✅ Deploy Preview for cockroachdb-api-docs canceled.
|
✅ Netlify Preview
To edit notification comments on pull requests, go to your Netlify site configuration. |
…tinuous monitoring.
…lyze using crdb_internal tables. In crdb-internal.md, moved the column table to include file transaction-contention-events-columns.md.
…lysis of support scenario.
…ng Insights page. In optimize-performance.json, added link to monitor-and-analyze-transaction-contention.html.
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.
Thanks, Florence! I just added one minor comment but otherwise this looks great!
src/current/_includes/v25.1/transaction-contention-events-columns.md
Outdated
Show resolved
Hide resolved
suggestions from docs-reviewer-gpt: |
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.
GREAT doc! Thanks for putting this together Florence. Approved pending nits.
|
||
It is crucial to understand where [transaction contention]({% link {{ page.version.version }}/performance-best-practices-overview.md %}#transaction-contention) occurs and how it impacts your workload. Contention is a normal part of database operations. In many cases, it has limited impact on a workload. For example, a large number of contention events with a very short duration may not impact your workload. Similarly, a small number of contention events with longer duration may be acceptable if they occur outside the “user path”. However, if contention substantially contributes to query latency, it should be addressed. | ||
|
||
This page shows how to monitor and analyze two types of contention: [lock contention]({% link {{ page.version.version }}/performance-best-practices-overview.md %}#transaction-contention) and [serializable conflicts]({% link {{ page.version.version }}/performance-best-practices-overview.md %}#transaction-contention). These types of contention are exposed via different observability mechanisms: |
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.
Nit: These types of contention are exposed via different observability touchpoints.
|
||
The remaining sections address analyzing contention once identified: | ||
|
||
- [Analyze using `crdb_internal` tables](#analyze-using-crdb_internal-tables): A process to determine which workload and queries are involved in the contention. |
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 call out that not all crdb_internal are production ready and to refer to the doc here?
|
||
- [Failed Execution]({% link {{ page.version.version }}/ui-insights-page.md %}#slow-execution) | ||
|
||
A statement or transaction that failed due to a serialization error is identified as a Failed Execution. If the serialization error was due to contention, there is a conflicting or blocking transaction recorded. The execution details will show the conflicting transaction. |
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.
We capture all types of failures but for serialization errors, we capture more info (conflicting info) to help troubleshoot.
`txn.restarts.writetooold` | Number of restarts due to a concurrent writer committing first | COUNTER | COUNT | ||
|
||
{{site.data.alerts.callout_info}} | ||
Since these metrics are not categorized by database, interpreting them can be challenging. |
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.
Do we really need to call out it's challenging? Users can correlate these metrics with insights and SQL activity and find the 'database'
Since these metrics are not categorized by database, interpreting them can be challenging. | ||
{{site.data.alerts.end}} | ||
|
||
## Monitor using `crdb_internal` tables |
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 call out that not all are production-ready
Fixes DOC-12277
Rendered preview