Skip to main content

Deploying Sidekiq To Heroku Discussion

General • Asked by Chris Oliver

Chris, another great episode! At the moment I have this in my Procfile: worker: bundle exec sidekiq -c 5 -q default -q mailers, since the only type of worker in my app is the mailer worker. At the moment it's not totally clear for me when/how I have to define the type of the worker. Let's say I would add another type (not mailer) of job to my app, but I don't want to scale my heroku dyno up since my one worker dyno has enough capacity to do both the mailer type and the other type of bg job. Could you tell me how you deal with that? I hope you will publish more videos about getting apps production ready on heroku :)

Great question. I would actually remove the queues you listed and then Sidekiq will process everything by default. You don't really need to separate out queues until you have so much background work happening that it makes sense to separate and prioritize them.


In the video you switched capitalization for the config option - for puma it should be `-C` while sidekiq expects `-c`.

Maybe they both support -C? Sidekiq's docs still show the capital one. https://github.com/mperham/...


Hi,
I have a problem with heroku.
It seems like every time I make changes to the migrations and run git push heroku master, heroku run rake db:migrate, I get an error in development when opening the current user's profile. All existing users seem to have this problem, while the new users after the migration update work well. This means that I would have to delete the existing users and recreate them, but that would not be possible if actual users use the app.
Is there a way to fix this without having to delete the existing users after every migration update on heroku?
Thank you.

I don't think you mentioned what the error is. What are you seeing?

I get the we're sorry, but something went wrong message. It does not exactly say what is wrong. However, I deleted the existing users and the new users work well. I am asking mostly because I will be adding new migrations again for the users and might run into the same problem again.
There are no validations I have added or anything of that sort where there might be a nil where there shouldn't be.
I was mostly wondering if there was another step to take when adding new migrations in development after adding them in production.

You'll want to check your Heroku logs to find out what crashed when you get the "Something Went Wrong" 500 error. It will tell you what code crashed.

If you deploy new migrations, you'll need to also run heroku run rails db:migrate to make sure production gets the new database changes as well.

Allright, thank you. I will do that once I add more migrations if the same problem occurs!
Yes, I used the heroku run rake db:migrate, but I am guessing there were problems in the new migrations for the existing users.
I will let you know what the logs show if it happens again!


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.