Sidekiq is a simple and efficient background processing tool for Ruby on Rails apps. You should use it for tasks that take too long to put in a controller or tasks that need to run on a schedule. Common examples are sending emails, generating pdf’s and connecting to other services through an API.
Like all things in IT, Sidekiq can crash, get slow or need more capacity. And for some applications that really should not happen. Because nobody directly interacts with Sidekiq it can be a long time before someone notices that something is wrong.
A good solution to quickly restart (kick, hehe) a crashed Sidekiq is to have a watchdog on the server. Both systemd and upstart can do that for you, and there are lot of other watchdogs you can install. But I’d still like to know something happend, or when an edge case happens where the watchdog cannot fix it. The solution? Monitoring Sidekiq from the outside.
Continue reading “Monitoring Sidekiq with email and SMS alerts”
How do you know your Rails app is still online? How do you know it’s not displaying some error? That’s what monitoring is for. If you look around you’ll find lots of solutions. Most of these solutions are overkill if you are just starting with Rails servers or if you only have a few applications.
What is important when choosing a monitoring tool?
Continue reading “Simple downtime alerts for your Rails app in 5 minutes”
It sounds convenient right? Install a server once and every time you build an app you add it to the server. If you update something on the server it will be updated for all the apps at the same time. Which may save you time and money.
Is it hard to install multiple apps on the same server? No not at all. Will it save you time setting things up? Yes. Will it make you happy in the long run? No!
Continue reading “Why you shouldn’t run two Rails apps on the same server”
What if your terminal couldn’t scroll back? When I just started using Tmux I didn’t know how to scroll back so I used to run Rails Server in a seperate terminal.
When I finally figured out how to scroll back up I also learned the hard way that you have to scroll down or otherwise your Rails server (and the whole app) will hang.
There are 2 ways of scrolling in Tmux. You can configure them in your .tmux.conf and they can be used together.
Continue reading “How to scroll back in Tmux”