Sidekiq as a background processing facility in Rails, usually more and more important during business grow, but it's relative quite possible failed to startup due to there is some code error, so here is my solution to monitor it.
I choose the monit instead of god beause monit is written in C and very small memory footprint. The capistrano-sidekiq also having a out of box support, but when you combine with monit, capistrano, sidekiq it still trick, so I feel writing a blog is worth.
Some situation is better avoid Sidekiq like reporting the exception mail, so it's always the best practices to building a Postfix Satellite SMTP service instead.
Install Postfix
yuminstall-ypostfixcyrus-sasl-plain# cyrus-sasl-plain is no need for Ubuntu
yumerase-ysendmail*# In case Sendmail is installed
Configure
Similar to gmail or SendGrid, every mail service vendor offer different combination of setting, below is only apply to AliYun
I'm stucked quite a while when refresh a Galaxy Note II for friends, so I decide write something down:
Wait some time after USB drive installed N7100 driver, something due to china poor network and gfw, the driver install from internet may failed.
Root before install any 3rd party recovery, it's hardest part of change, I reference this for the Europe model, but you may need to found another way. This is must need before refresh any 3rd party recovery, because seems if not rooted, Knox will stop you do any further action.
When the hkp port blocked, so rvm suggested gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 always failed to running, here is how to resolve such problem.
Find a hkp port not block server, run export after import the key:
eventmachine didn't release a new gems for a long time, so we have to manually compile if you decide using Ruby 2.1.3, it's probably the most complex gems which can still successfully install on windows as far as I known, here is the steps for your interesting:
git clone https://github.com/eventmachine/eventmachine
cd eventmachine && bundle install
Now you will meet the bluecloth can not install problem first, which you can following stackoverflow steps including patch ext/bluecloth.h and 6 steps.
Now you need using updated version of rake-compiler (v0.9.3) to continue, so change eventmachine.gemspec to that version and do the bundle install again.
Now we can running rake package and it should generate the updated 1.0.3 gem file you need, but before that you need another depend lzma package mentioned in Ruby Installer Google Group, I only tested x86 but the x64 should be same.
Except simply install the ruby 2.1.3 from rubyinstaller and it's DevKit, here is my log when I meet the problem during ruby 2.1.3 on a Windows 7 32bits machine.
Comments out the warn "DL is deprecated, please use Fiddle" at C:\Ruby21\lib\ruby\2.1.0\dl.rb
Install yajl-ruby via gem install yajl-ruby -v 1.1.0 --platform ruby
Install RedCloth via gem install RedCloth --platform ruby and move the file C:\Ruby21\lib\ruby\gems\2.1.0\gems\RedCloth-4.2.9\lib\redcloth_scan.so to new created folder C:\Ruby21\lib\ruby\gems\2.1.0\gems\RedCloth-4.2.9\lib\2.1.