ruby - Reset cache in Thin instances launched by Unicorn -
I have a Ruby WebF that caches some frequently used information in the light layer, but many times I I want to reset the cache without restarting the whole process.
Before using Unicorn, I had a known list of ports that I can send a special HTTP request to reset the cache at each instance. However, under Unicorn, the Unicorn process handles all HTTP requests and sends them to different processes in children.
Under this model, there is a simple mechanism for sending a message to each launched example, reset your cache?
You can configure workers for each after_fork with each main port and for each of those ports Send request. See the documentation.
Comments
Post a Comment