-
Notifications
You must be signed in to change notification settings - Fork 86
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
TT-10676 Upgrade Resurface Pump backend #773
Conversation
Fixing PR: track the progress here.I'm currently fixing this PR to address the following: [Sweep GHA Fix] The GitHub Actions run failed with the following error logs:
An error has occurred: 422 {"message": "Validation Failed", "errors": [{"resource": "PullRequest", "code": "custom", "message": "No commits between TT-10676 and sweep/sweep_gha_fix_the_github_actions_run_fai_3efa2"}], "documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request"} (tracking ID: 02f771dc1e) |
API tests result - postgres15-sha256 env: success ✅ |
API tests result - mongo44-sha256 env: success ✅ |
rp.log.Info(rp.GetName() + " Initialized") | ||
return nil | ||
} | ||
|
||
func (rp *ResurfacePump) initWorker() { | ||
rp.data = make(chan []interface{}, 5) |
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.
@monrax could I ask you again what's the reason why the size of this channel is hardcoded to 5?
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.
hi @mativm02 , sorry for the late reply -- Good catch! Ideally, it would be 1 instead of 5. Although, after some load testing I found this to be a good queue depth. I do agree it would be better to make it configurable by defining a new parameter for this pump backend. Please, let me know if this is a priority for y'all and I'll make sure to submit a new PR with this change. Thanks!
API tests result - postgres15-murmur64 env: success ✅ |
API tests result - mongo44-murmur64 env: success ✅ |
/release to release-1.9 |
Working on it! Note that it can take a few minutes. |
* feat(resurface): upgrade ResurfacePump backend * fix(resurface): flush messages before checks * feat(resurface): upgrade ResurfacePump backend * linting * improving context handling * linting --------- Co-authored-by: Ramón Márquez <[email protected]> (cherry picked from commit 8ca8646)
@mativm02 Succesfully merged PR |
TT-10676 Upgrade Resurface Pump backend (#773) * feat(resurface): upgrade ResurfacePump backend * fix(resurface): flush messages before checks * feat(resurface): upgrade ResurfacePump backend * linting * improving context handling * linting --------- Co-authored-by: Ramón Márquez <[email protected]>
This is a copy of the PR created by @monrax: #731
Upgrade the Resurface backend for the Tyk Pump. This upgrade makes the data writing process asynchronous through the use of bounded channels. In addition, the
Shutdown
method has been defined to support graceful shutdown.Description
logger-go
dependency to version 3.3.1, which includes improvements in goroutine management, as well as a newStop
method for graceful shutdown.Shutdown
method for graceful shutdown ofResurfacePump
backend.Related Issue
Issues #729 and #730
Motivation and Context
Stop
method for graceful shutdown of the data capture process.WriteData
might take a long time to return (e.g. longer than the configured redis TTL). This can be a bottleneck that can affect the entire data capture process.How This Has Been Tested
docker-compose.yml
file:pump.conf
file to configure the Resurface pump backend without any timeout:/image/png
endpoint aiming for >4000 RPS (Configurations used: Locust: 2 workers, 50 spawn rate, and 6000 users; Bombardier: concurrency level of 100 with 500k requests)Screenshots (if appropriate)
Types of changes
Checklist
fork, don't request your
master
!master
branch (left side). Also, you should startyour branch off our latest
master
.go mod tidy && go mod vendor
go fmt -s
go vet