Skip to content

use rwlock for public jwk keys#38

Merged
trchopan merged 1 commit intotrchopan:mainfrom
dannyboland:main
Apr 9, 2025
Merged

use rwlock for public jwk keys#38
trchopan merged 1 commit intotrchopan:mainfrom
dannyboland:main

Conversation

@dannyboland
Copy link
Contributor

@dannyboland dannyboland commented Mar 26, 2025

Likely not relevant for most use cases but we can improve concurrency by using RwLock to allow concurrent reads of jwk keys.

Load testing

Tested with the axum-basic example.

Main branch:

> cargo run --release
> oha -m GET "http://127.0.0.1:8080/hello" -H "Authorization: Bearer $auth" -c 100 -z 10s
Requests/sec:	29876.7008

This branch:

> cargo run --release
> oha -m GET "http://127.0.0.1:8080/hello" -H "Authorization: Bearer $auth" -c 100 -z 10s
Requests/sec:   129176.3504

@trchopan
Copy link
Owner

trchopan commented Apr 9, 2025

Great!! Thank you for PR, and teaching me this optimization 🙏

@trchopan trchopan merged commit 6ae0f11 into trchopan:main Apr 9, 2025
2 checks passed
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