-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: perf issues when purging system.web_sessions #88622
Labels
A-observability-inf
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Comments
aadityasondhi
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-observability-inf
labels
Sep 23, 2022
aadityasondhi
added a commit
to aadityasondhi/cockroach
that referenced
this issue
Sep 26, 2022
The previous purging limit was found to be too low which resulted in the `system.web_sessions` table growing rapidly. Additionally, we were using `ORDER BY random()` when deleting expired sessions from the table which caused a full table scan of a large table. This resulted in high cpu usage on every purge attempt with only very few rows actually being deleted. Over time, this turns into a nonideal feedback loop. This change fixes the two issues by: 1. Increasing the defauilt purging limit to 1000 from 10. 2. Remove the `ORDER BY random()` when purging the table to avoid full table scans on every purge. support ticket: cockroachlabs/support#1812 resolves cockroachdb#88622 Release note: None
aadityasondhi
added a commit
to aadityasondhi/cockroach
that referenced
this issue
Sep 29, 2022
The previous purging limit was found to be too low which resulted in the `system.web_sessions` table growing rapidly. This happened when a customer-side automation script was generating a large number of sessions. Additionally, we were using `ORDER BY random()` when deleting expired sessions from the table which caused a full table scan of a large table. This resulted in high cpu usage on every purge attempt with only very few rows actually being deleted. Over time, this turns into a nonideal feedback loop. This change fixes the two issues by: 1. Increasing the defauilt purging limit to 1000 from 10. 2. Remove the `ORDER BY random()` when purging the table to avoid full table scans on every purge. support ticket: cockroachlabs/support#1812 resolves cockroachdb#88622 Release note: None
craig bot
pushed a commit
that referenced
this issue
Oct 13, 2022
88766: server: fix bottlenecks when purging system.web_sessions r=dhartunian a=aadityasondhi The previous purging limit was found to be too low which resulted in the `system.web_sessions` table growing rapidly. This happened when a customer-side automation script was generating a large number of sessions. Additionally, we were using `ORDER BY random()` when deleting expired sessions from the table which caused a full table scan of a large table. This resulted in high cpu usage on every purge attempt with only very few rows actually being deleted. Over time, this turns into a nonideal feedback loop. This change fixes the two issues by: 1. Increasing the defauilt purging limit to 1000 from 10. 2. Remove the `ORDER BY random()` when purging the table to avoid full table scans on every purge. support ticket: https://github.com/cockroachlabs/support/issues/1812 resolves #88622 Release note: None Co-authored-by: Aaditya Sondhi <aadityas@cockroachlabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-observability-inf
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
This issue was seen in: https://github.com/cockroachlabs/support/issues/1812
In summary, the customer experienced increased CPU usage when the
system.web_sessions
table grew large.In the investigation, it was found that the suggested fix would be to:
ORDER BY random()
incockroach/pkg/server/purge_auth_session.go
Lines 83 to 158 in 6971977
Jira issue: CRDB-19912
The text was updated successfully, but these errors were encountered: