-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix timeout and concurrency layer #51
Conversation
.route_layer(TimeoutLayer::new(Duration::from_secs(self.timeout.unwrap_or(30)))) | ||
.route_layer( | ||
ConcurrencyLimitLayer::new( | ||
self.max_connections.unwrap_or(1024), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for 1024? If so a comment would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't have a very concrete reason, just from the past we have only really seen 10 qps from the api side
@@ -295,7 +309,6 @@ impl Server { | |||
.allow_origin(Any), | |||
) | |||
.layer(CompressionLayer::new()) | |||
.layer(TimeoutLayer::new(Duration::from_secs(self.timeout.unwrap_or(30)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious: why didn't this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not totally sure, I suspect that the very slow requests we saw were partially due to no concurrency limit, so there were just too many threads spawned and the timeout didn't trigger at the expected time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to see timeout (408 status) locally when picking a very low timeout, so it is definitely configured correctly
* Add kafka feature and stream * Suppress brc20 sats logs (#33) * Suppress brc20 sats logs * update comment * optimized palindrome generation (#34) * Fix content type (#35) * Fix content type * Bump version * Add dev branch to CI * Fix tests (#38) * add cache to store old owner for stream event (#43) * [ord] Remove block time again..... (#48) * [ord] Remove block time again..... * Fix lint * fix lint again * Skip pending check when listing sat ranges (#49) * skip more events (#50) * Fix timeout and concurrency layer (#51) * Fix tests * Update to v9 message (#53) * Fix old owner cache key (#54) * Add charms to StreamEvent (#55) * 7 more types of rare sats (#57) * 3 more types of rare sats * format * 4 more rarities * fix ut * exclude end sat from palindrome scanning * block286 (#58) * New rare sats (#59) * new rare sats * fix lint * fix lint * rename blocks_in_if_conditions to blocks_in_conditions * disable taproot from rpc (#60) * Merge consecutive hitman ranges within same block (#61) * merge consecutive hitman ranges within same block * change array size * Fix tests * Update to v10 message --------- Co-authored-by: Rex <rex@magiceden.io> Co-authored-by: haozhiliu <136628919+haozhiliu@users.noreply.github.com> Co-authored-by: Zhuojie Zhou | rex <89176731+nothing0012@users.noreply.github.com> Co-authored-by: Destiny Chen <110491217+destinymagicchen@users.noreply.github.com>
Suppress brc20 sats logs (#33) * Suppress brc20 sats logs * update comment optimized palindrome generation (#34) Fix content type (#35) * Fix content type * Bump version Add dev branch to CI Fix tests (#38) add cache to store old owner for stream event (#43) [ord] Remove block time again..... (#48) * [ord] Remove block time again..... * Fix lint * fix lint again Skip pending check when listing sat ranges (#49) skip more events (#50) Fix timeout and concurrency layer (#51) Fix tests Update to v9 message (#53) Fix old owner cache key (#54) Add charms to StreamEvent (#55) 7 more types of rare sats (#57) * 3 more types of rare sats * format * 4 more rarities * fix ut * exclude end sat from palindrome scanning block286 (#58) New rare sats (#59) * new rare sats * fix lint * fix lint * rename blocks_in_if_conditions to blocks_in_conditions disable taproot from rpc (#60) Merge consecutive hitman ranges within same block (#61) * merge consecutive hitman ranges within same block * change array size Fix tests Update to v10 message Add delegate field
Suppress brc20 sats logs (#33) * Suppress brc20 sats logs * update comment optimized palindrome generation (#34) Fix content type (#35) * Fix content type * Bump version Add dev branch to CI Fix tests (#38) add cache to store old owner for stream event (#43) [ord] Remove block time again..... (#48) * [ord] Remove block time again..... * Fix lint * fix lint again Skip pending check when listing sat ranges (#49) skip more events (#50) Fix timeout and concurrency layer (#51) Fix tests Update to v9 message (#53) Fix old owner cache key (#54) Add charms to StreamEvent (#55) 7 more types of rare sats (#57) * 3 more types of rare sats * format * 4 more rarities * fix ut * exclude end sat from palindrome scanning block286 (#58) New rare sats (#59) * new rare sats * fix lint * fix lint * rename blocks_in_if_conditions to blocks_in_conditions disable taproot from rpc (#60) Merge consecutive hitman ranges within same block (#61) * merge consecutive hitman ranges within same block * change array size Fix tests Update to v10 message Add delegate field
Suppress brc20 sats logs (#33) * Suppress brc20 sats logs * update comment optimized palindrome generation (#34) Fix content type (#35) * Fix content type * Bump version Add dev branch to CI Fix tests (#38) add cache to store old owner for stream event (#43) [ord] Remove block time again..... (#48) * [ord] Remove block time again..... * Fix lint * fix lint again Skip pending check when listing sat ranges (#49) skip more events (#50) Fix timeout and concurrency layer (#51) Fix tests Update to v9 message (#53) Fix old owner cache key (#54) Add charms to StreamEvent (#55) 7 more types of rare sats (#57) * 3 more types of rare sats * format * 4 more rarities * fix ut * exclude end sat from palindrome scanning block286 (#58) New rare sats (#59) * new rare sats * fix lint * fix lint * rename blocks_in_if_conditions to blocks_in_conditions disable taproot from rpc (#60) Merge consecutive hitman ranges within same block (#61) * merge consecutive hitman ranges within same block * change array size Fix tests Update to v10 message Add delegate field
Suppress brc20 sats logs (#33) * Suppress brc20 sats logs * update comment optimized palindrome generation (#34) Fix content type (#35) * Fix content type * Bump version Add dev branch to CI Fix tests (#38) add cache to store old owner for stream event (#43) [ord] Remove block time again..... (#48) * [ord] Remove block time again..... * Fix lint * fix lint again Skip pending check when listing sat ranges (#49) skip more events (#50) Fix timeout and concurrency layer (#51) Fix tests Update to v9 message (#53) Fix old owner cache key (#54) Add charms to StreamEvent (#55) 7 more types of rare sats (#57) * 3 more types of rare sats * format * 4 more rarities * fix ut * exclude end sat from palindrome scanning block286 (#58) New rare sats (#59) * new rare sats * fix lint * fix lint * rename blocks_in_if_conditions to blocks_in_conditions disable taproot from rpc (#60) Merge consecutive hitman ranges within same block (#61) * merge consecutive hitman ranges within same block * change array size Fix tests Update to v10 message Add delegate field
Demo locally running with
--max-connections 5
and sending 20 requests in parallel, only 5 are executed at a timehttps://www.loom.com/share/5cd4044c5f244b6780820a4f646db6de