This repository was archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
fix: Remove num_queries counting to avoid excessive DB writes #421
Merged
Conversation
This file contains hidden or 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
Codecov Report
@@ Coverage Diff @@
## main #421 +/- ##
==========================================
- Coverage 48.90% 48.84% -0.06%
==========================================
Files 52 52
Lines 8322 8332 +10
==========================================
Hits 4070 4070
- Misses 4252 4262 +10
Continue to review full report at Codecov.
|
* Set the retention time since last update to one month.
achimnol
added a commit
that referenced
this pull request
May 10, 2021
* Now all DB transactions use the "SERIALIZABLE" isolation level with explicit retries. * Now DB transactions that includes only SELECT queries are marked as "read-only" so that the PostgreSQL engine could optimize concurrent access with the new isolation level. All future codes should use `beegin_readonly()` method from our own subclassed SQLAlchemy engine instance replacing all existing `db` context variables. * Remove excessive database updates due to keypair API query counts and kernel API query counts. The keypair API query count is re-written to use Redis with one month retention. (#421) Now just calling an API does not trigger updates in the PostgreSQL database. * Fix unnecessary database updates for agent heartbeats. * Split many update-only DB transactions into smaller units, such as resource recalculation. * Use PostgreSQL advisory locks to make the scheduling decision process as a critical section. * Fix some of variable binding issues with nested functions inside loops. * Apply event message coalescing to prevent event bursts (e.g., `DoScheduleEvent` fired after enqueueing new session requests) which hurts the database performance and potentially break the transaction isolation guarantees.
achimnol
added a commit
that referenced
this pull request
May 10, 2021
* This is to avoid excessive write transaction overheads to the database. * Set the retention time since last update to one month. Backported-From: main Backported-To: 21.03
achimnol
added a commit
that referenced
this pull request
May 10, 2021
* This is to avoid excessive write transaction overheads to the database. * Set the retention time since last update to one month. Backported-From: main Backported-To: 20.09
achimnol
added a commit
that referenced
this pull request
May 10, 2021
* Now all DB transactions use the "SERIALIZABLE" isolation level with explicit retries. * Now DB transactions that includes only SELECT queries are marked as "read-only" so that the PostgreSQL engine could optimize concurrent access with the new isolation level. All future codes should use `beegin_readonly()` method from our own subclassed SQLAlchemy engine instance replacing all existing `db` context variables. * Remove excessive database updates due to keypair API query counts and kernel API query counts. The keypair API query count is re-written to use Redis with one month retention. (#421) Now just calling an API does not trigger updates in the PostgreSQL database. * Fix unnecessary database updates for agent heartbeats. * Split many update-only DB transactions into smaller units, such as resource recalculation. * Use PostgreSQL advisory locks to make the scheduling decision process as a critical section. * Fix some of variable binding issues with nested functions inside loops. * Apply event message coalescing to prevent event bursts (e.g., `DoScheduleEvent` fired after enqueueing new session requests) which hurts the database performance and potentially break the transaction isolation guarantees. Backported-From: main Backported-To: 21.03
achimnol
added a commit
that referenced
this pull request
May 10, 2021
* Now all DB transactions use the "SERIALIZABLE" isolation level with explicit retries. * Now DB transactions that includes only SELECT queries are marked as "read-only" so that the PostgreSQL engine could optimize concurrent access with the new isolation level. All future codes should use `beegin_readonly()` method from our own subclassed SQLAlchemy engine instance replacing all existing `db` context variables. * Remove excessive database updates due to keypair API query counts and kernel API query counts. The keypair API query count is re-written to use Redis with one month retention. (#421) Now just calling an API does not trigger updates in the PostgreSQL database. * Fix unnecessary database updates for agent heartbeats. * Split many update-only DB transactions into smaller units, such as resource recalculation. * Use PostgreSQL advisory locks to make the scheduling decision process as a critical section. * Fix some of variable binding issues with nested functions inside loops. * Apply event message coalescing to prevent event bursts (e.g., `DoScheduleEvent` fired after enqueueing new session requests) which hurts the database performance and potentially break the transaction isolation guarantees. Backported-From: main Backported-To: 20.09
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.