-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Blocking strategy response slower than expected #282
Comments
Hello @Derkades is this issue still happening ? |
Hi, yes it appears this is still an issue with the latest :beta |
The first time sablier receives a request for a given container, it needs to check for its readiness. So even if it's already running, the first request will be longer than the next ones. Maybe I could pre-register all running containers, that could speed up things actually. Would you be able to create a reproducible scenario with a docker compose file so I can experience this issue ? |
Yes, thank you for your interest in solving this issue! This is my compose file: services:
sablier:
image: ghcr.io/acouvreur/sablier:beta
volumes:
- type: bind
source: ./sablier.yaml
target: /etc/sablier/sablier.yml
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
ports: ['127.0.0.1:10000:10000']
whoami:
image: containous/whoami:v1.5.0
labels:
- sablier.enable=true
- sablier.group=my-group
nginx:
image: nginxinc/nginx-unprivileged
volumes:
- type: bind
source: ./nginx.conf
target: /etc/nginx/nginx.conf
- type: bind
source: ./sablier.js
target: /etc/nginx/conf.d/sablier.js
ports: ['127.0.0.1:8080:8080'] And the sablier config file:
Nginx configuration:
|
Thanks @Derkades! Actually, I have found the issue: sablier/app/sessions/sessions_manager.go Line 228 in 8bfb37a
This checks every five seconds the readiness of the app. I can try to change some core behavior to be more event driven. For docker I know that I can watch events, so I might just do that at some point. I'll track this ticket for performance improvements. Note that, as always, performance improvement for Sablier always comes with you properly defining an healthcheck, otherwise Sablier cannot know the difference between started and ready to receive requests. |
Hi, thanks for the update! Is the session request an expensive operation? It seems like it can be done much more often, say every 100 milliseconds. Before doing a more complex rewrite to an event-based system. Thanks for the tip about defining a healthcheck, I'll keep that in mind when I start using it in production. |
I'm planning on considerably enhancing communication with providers. I'll use events instead of polling, meaning that we'll have real-time responses instead. I'll try to add that in the 1.8.0 release. |
Describe the bug
I have configured sablier with nginx and whoami for testing. A response takes slightly over 5 seconds when the whoami container is not running. Even when starting the container manually, then issuing a request a few seconds later, it still takes 5 seconds. But the next request is instant again. I feel like there is some unnecessary delay somewhere.
Context
The text was updated successfully, but these errors were encountered: