reduced sidekiq concurrency and increased pod resource limits #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When running in K8s, the pod will spike cpu and memory use that will trigger a pod restart. A link to this issue appears in the logs: RTT warning can signal CPU saturation · sidekiq sidekiq · Discussion #5039
The worker service has a concurrency setting in config/sidekiq.yml set to 5. Despite being lower than the default of 10, the pod will restart.
I found that setting concurrency to 2 and increasing the pod resource limits avoids regular restarts. The cpu and memory still spike but aren’t enough to trigger a restart.
How to test
K8s testing steps are outline in the k8s-manifests/readme. It's important to note that unlike Docker compose, K8s won't build container images. Images must be pre-built and hosted in a registry. For development, you can run a local registry. Then build and push images. The images must be built and pushed on the
workernode as that is where the services will run and look forlocalhost.The development K8s Sandbox is currently set to test.
On the worker terminal: cd to
root/lab/storedogcheckout this branch (git clone runs during track setup)
Run the build command in the k8s readme
On the control-plane terminal: cd to
root/lab/storedogcheckout this branch (git clone runs during track setup)
Follow the steps in the readme to setup the Datadog operator and start Storedog.
Watch the pods run:
watch kubectl get pods -n storedogPreviously, the worker pod would restart about every 3 minutes. Wait at least 10 minutes. I've let it run for a full hour to confirm.