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

ssmemstorage: improve lock contention on RecordStatement #106860

Merged
merged 1 commit into from
Jul 19, 2023
Merged

ssmemstorage: improve lock contention on RecordStatement #106860

merged 1 commit into from
Jul 19, 2023

Commits on Jul 19, 2023

  1. ssmemstorage: improve lock contention on RecordStatement

    1. The stats object lock was being held even during the insights event
    creation and insert which has it's own lock. The insights logic is now
    moved above the stats lock.
    2. Moved latency calculation outside the stats lock.
    3. Moved error code calculation outside the stats lock.
    4. ss_mem_storage converted to use a RWMutex. Each object in the map
    has it's own lock. Read lock allows mulitple threads to read from the
    map at the same time which is the common case. Writes are only done the
    first time a statement is seen.
    
    Fixes: #106789, Fixes: #55285
    
    Release note (performance improvement): Reduced lock contention on
    `ssmemstorage.RecordStatement`. This is useful for workloads that
    execute the same statement concurrently on the same SQL instance.
    j82w committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    a792cd3 View commit details
    Browse the repository at this point in the history