[Azure] Unnecessary cronjob increasing latency
We have a cron job running every 5 minutes just to update some ttl values from Partition service. Since we don't need to update such values at runtime this cronjob is unnecessary, and more than that, we strongly believe it is causing a significant multi-threading overhead to the service: after analyzing some entitlements requests extremely slow (latency > 1 minute), we realized some threads hanging around the same time the cronjob executes. As an empirical analysis, I removed the cronjob and its related config/annotations. After a couple of days running the entitlements version without the cronjob I noticed improvements in 99 request latency percentile as well as the absence of those lengthy requests. FYI, some useful references related to the issue.
- the
@EnableAsync
tag is misplaced. It should be used in a@Configuration
class and not in an application level. - the
@EnableScheduling
tag is misplaced. It should be uses as localized as possible (method level) and not at application level.
Can we completely eliminate this cronjob from Azure deployment?