Skip to content
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

perf release mutex while waiting for retry #5499

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anysql
Copy link
Contributor

@anysql anysql commented Jan 3, 2025

Adjust the mutex scope for txn of redis/sql/tikv meta engine

@anysql
Copy link
Contributor Author

anysql commented Jan 3, 2025

All other time.Sleep are all out of mutex scope.

@davies
Copy link
Contributor

davies commented Jan 3, 2025

The reason we have sleep here is to reduce the concurrency of transactions, it will be useless if it unlocks the mutex.

@anysql
Copy link
Contributor Author

anysql commented Jan 3, 2025

We have 1024 mutex here, if all are active, still too high concurrency for the backend database, so I feel is not used to limit the overall transaction concurrency. It's used to limit the transaction concurrency of single file or directory, as it is usually processed serially in backend.

By the way, for sql engine there are backend solution for high concurrency control, such as thread pool or proxy etc.

@anysql
Copy link
Contributor Author

anysql commented Jan 6, 2025

#5512 limit the maximum connections is another good way to control the transaction concurrency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants