On our servers, we have deployed several rail applications using fusion passenger. Each application has a set of tasks that should be set from time to time (normal clear cache, sending mail etc.)
Any example that I have seen in the wild is usually a different daemon Shows which handles fixed tasks for an application, however, it requires that the daemon loads the environment of the application. When it works when one or two apps are deployed by you, it does not increase when there may be 100 apps posted on a server. (For example, each "daemon" increases an entire rail environment, as well as the app code, which can be more than 50 MB. Deploy 100 apps, and you are chewing up the scheduler daemon up to 5 GB.) < / P>
Has anyone solved this problem?
I think the answer depends on your needs. If those tasks take a lot of time, then the simplest solution is to do it in a traditional way with Daemon. If you want to trust the rail stack, you have to load it in memory to use it - you will not be able to escape it.
If your tasks do not require much time, then you can do something like: Available methods that are available (like), but start and stop the DAEMON periodic (look for some tips). So you can start at 9 a.m. and stop them at 10 o'clock. Then you can start 10 and the other. Start and stop can be done with a cron or any similar device.
However, if your work is really simple and very similar, you can only write your script for a job. For example, if "normal scrub cache" means that you delete some files from some directories, then just run it in the script and put it in periodic form. Sending an email can also be done through a script (Ruby program). Ruby is really easy to bring any data from DB. Then this program can periodically check the table in the mails_queue
database and send an email. If you have the same application then it will be easy to achieve it.
Perhaps there are some ready solutions, but I have not heard of them.
Comments
Post a Comment