Don’t Use WEBrick on Production
Story time with Travis Luong. This happened a few years ago when I first started doing Ruby on Rails development. I was working with a client on a sweepstakes website featuring a fairly prominent KPOP band. When the site was launched, it received a spike of traffic from fans. To my surprise and dismay, there were constant timeouts and errors. I scrambled to find a solution by tweaking cache and database settings. I also tried scaling Heroku dynos. Nothing seemed to work.
I must have stumbled across some article on the internet, but I realized that I had not swapped out the default WEBrick web server. As soon as I switched to Unicorn, all issues were resolved. Fortunately I had discovered the issue quickly, otherwise it would have been a total disaster. Apparently, WEBrick is intended for development purposes only, a lesson I learned the hard way. Well, I hope others new to Ruby on Rails can learn from my mistake.