4 ms·
> One such performance improvement involved moving the logic to check a user’s enabled features into a background thread that refreshed on an interval rather th
by tcgv 6y ago
> One such performance improvement involved moving the logic to check a user’s enabled features into a background thread that refreshed on an interval rather than checking their enablement while the request was being processed
It's never a good idea to perform multithreaded operations within the web server, unless you have a strong knowledge of its internal workings. For instance, if you miss manage threads in an IIS web application you can end up having your web requests queued since the web server has by default a fixed number of worker threads to serve web requests.
From their bug description it's clear that ruby on rails is no exception to this rule. In such cases where background processing is required due to some condition triggered by a web request it's best to stick with a propper queue system [1]
[1] https://thomasvilhena.com/2019/07/using-queues-to-offload-web-api https://thomasvilhena.com/2019/07/using-queues-to-offload-we...