-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addresses #1785 and partially addresses #1770 Moves a lot of the operations that went through `ShapeCache` directly into the `Shape.Consumer`, so that requests can be replied to directly from the shape consumers rather than flooding the `ShapeCache` with casts that take a while to reach the requesters. I've tried to keep changes to a minimum in order to do this incrementally and keep these PRs easily reviewable - the `ShapeStatus` still persists data on every call, the relations and truncates still go through `ShapeCache` rather than individual shapes, etc I've also caught the `DBConnection.ConnectionError`s for queue timeouts and converted them to 429 errors. We need to also handle `GenServer.call` timeouts as sometimes the PG query might not fail but take longer than the default 5 seconds for the GenServer call. NOTE: I have not updated any tests yet as I first want to ensure people agree with the approach PERFORMANCE CHECK: - On my local machine, using in memory stores, running 1000 concurrent new shape connections consistently took ~20sec with these changes, compared to the ~33sec on main, so a ~30% improvement. - I was also able to succesfully run 10k concurrent connections with this, although it took ~10min to serve, but on main I wasn't able to succsefully run it (@robacourt I think that was the case for you too?) - at least we know it does not get into an unrecoverable state.
- Loading branch information
Showing
11 changed files
with
198 additions
and
152 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.