ystia/yorc

Add a configuration parameter to tune tasks dispatcher metrics refresh time

laurentganne opened this issue · 0 comments

On a setup with just one deployment, although there is no workflow activity, consul shows an important disk writes activity of 60 K/s.

The command consul monitor -log-level debug | grep PUT | grep _yorc shows yorc acquires one lock per deployment task every second:

16:03:19 [DEBUG] http: Request PUT /v1/session/create?dc=dc1 (1.34792ms) from=127.0.0.1:38196
16:03:19 [DEBUG] http: Request PUT /v1/kv/_yorc/tasks/5c68f529-5db6-419d-9751-ad434166cd9b/.runningExecutionsLock?acquire=4c28b673-dfc6-6876-244e-9b8c93b19185&dc=dc1&flags=3304740253564472344 (939.545µs) from=127.0.0.1:38196
16:03:19 [DEBUG] http: Request PUT /v1/kv/_yorc/tasks/5c68f529-5db6-419d-9751-ad434166cd9b/.runningExecutionsLock?dc=dc1&flags=3304740253564472344&release=4c28b673-dfc6-6876-244e-9b8c93b19185 (861.453µs) from=127.0.0.1:38196
16:03:19 [DEBUG] http: Request PUT /v1/session/destroy/4c28b673-dfc6-6876-244e-9b8c93b19185?dc=dc1 (1.682062ms) from=127.0.0.1:39140

This is coming from the workflow tasks dispatcher taking a lock for each task to compute the number of waiting executions and emit the corresponding metric, every second.
A configuration parameter should be added to tune this time to refresh this dispatcher metrics, with a default value of 5 minutes, to avoid excessive usage of disk writes.