Added process_queues service to cdo-apps chef cookbook#9205
Conversation
|
Using a crontab If we want this to be managed in a more automated way, these are our options:
|
There was a problem hiding this comment.
Looking at the syntax of process_queues_daemon, doesn't this take an -r option, like process_queues_daemon -r restart?
also, could we use start rather than restart on this since this will only be run on reboot? Running restart will throw a warning if the service is not already started, which I think might cause email/honeybadger alert to be triggered.
There was a problem hiding this comment.
nevermind on the -r, looks like it uses the first argument as the default command when -r isn't provided.
|
another quick-and-dirty approach that wouldn't require the full OS service integration would be to add a Chef |
|
Thanks for all the detailed suggestions! The only place I really care about it running is on production-daemon. Test and Staging also have queues set up, so it could run there but we're not necessarily expecting it to process anything. The unit tests run with fake_sqs and don't need a processor daemon. I can always set it up manually if I need for an adhoc server, as we'll have to set up the queue_url configurations anyway. That said, I like the sound of "less fuss", so I'd lean toward the poise_service or execute resource approach. In either case, would I need to create a new entry under cookbooks? I haven't worked with chef recipes before so I'm a little unclear on the details. Since this is already using the daemon gem, do we get added benefit with poise_service over execute? Good point about the warning on restart. I do want to restart (or otherwise coerce it to pick up config changes) on deploy, so maybe do something similar to your proposed execute command but wth restart if it's already running and start otherwise? |
6a866cd to
2fbd427
Compare
2fbd427 to
d40e4fa
Compare
|
Second attempt, now with poise_service. Please take another look. Followup item: we still need to find a way to deal with config changes in the future. |
|
I think this looks good, though worth thinking about whether we want to process queues only on the daemon, or if we want to also process them in parallel across all frontends as well (tasks would be distributed randomly on a first-come-first serve basis). Since this is only going to be a low-volume queue for now, maybe easier debugging-wise to have the service run only on the daemon for starters? If so, wrapping an |
|
I agree only daemon for now. This is going to be low volume. We can reevaluate if we revive the high volume activity queue for HOC (which ran on two servers last year) or something similar. Updated with the daemon conditional. |
|
Great! So the current code will use a separate SQS queue for each of our daemon-managed server environments ( If these queues were manually created via the AWS console, a future task would be to describe and maintain them via our cloudformation stack template - not necessary for this initial rollout (more a note to myself to circle back around for this later). |
|
I created queues in the AWS console for staging, test, and production. I didn't do levelbuilder, but we shouldn't be creating workshops there and without a queue the action will simply process synchronously and the queue processor will no-op. Do you think we should have a queue for levelbuilder too? |
|
Ah, so adding all of the queues isn't necessary with the synchronous fallback in place. Sounds good! 👍 |
Open question: What about deployment? Can we make sure it restarts on deployment so it will start in the first place without a reboot, and also pick up config changes? Any suggestions?