-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design for Database connection? #7
Comments
Hey Kit, each task is completely is launching in completely isolated 2014-07-31 16:56 GMT+06:00 Kit Ho [email protected]:
|
Not quite understand the workaround. I would like to know if IronWorker Is good fit for my use case? ( update DB for some rows, >500ms or less than 2sec but long enough to be async task). |
in this case only second approach will fit your needs - put them in MQ and 2014-07-31 17:07 GMT+06:00 Kit Ho [email protected]:
|
Hey Kit, so what'd you do is keep a couple workers running and have them read off IronMQ for "jobs". Your app woudl then just be responsible for putting jobs into IronMQ to be read off by workers. This way the IronWorker task will only open up a connection to the DB when there are avaialble jobs and process as many as it can. Maybe 10, 20, 100, and then die. You can use push queues to kick up the IronWorker the first time, and it will read as many jobs as it can until queue is empty. |
Your proposal would be scheduled the iron worker tasks to be run in time interval (say 1min), then read as many as job in the IronMQ. |
Yes that was one of the proposed solutions 2014-08-01 8:23 GMT+06:00 Kit Ho [email protected]:
|
And/or use our alerts feature to trigger the IronWorker to run. |
Hi
I am going to implement an Application using IronWorker. But I got something weird for using IronWorker.
My Background task is going to do update my database on some records, write some statistics data to DB. The whole task is not long ( >500ms or less than 2sec but long enough to be async task).
This task is always be triggered as lots of requests come in my Web tier.
My Question is if using ironworker, i have to connect and disconnect the database connection everytime the task start. I am not sure if this would be good design as it seems trigger a lot of overhead to the database connection.
Or is there other way to do?
Thanks
Kit
The text was updated successfully, but these errors were encountered: