hedgehog lab

Sarat Pediredla

Rails performance tips

by Sarat Pediredla

We have been recently working on a top-secret Rails app and performance has been a primary consideration. Although I agree that “scaling is a nice problem to have sometime in the future“, it does not mean we throw good software design out of the window. It causes a lot less pain and effort designing something better from the ground-up than re-factoring an entire code-base at a later point.

With this in view, we set about investigating a few pointers to improving Rails performance. A note that all of these are links that have been collected from our days learning Rails from various sources on the web. I just could not let these languish in our internal wiki!

Sarat Pediredla

Easing MySQL pain when using Locomotive and XAMPP

by Sarat Pediredla

If you are one of those n00bs that are looking to learn Ruby on Rails on a Mac OS X and happen to use the unfortunate combination of Locomotive and a XAMPP-based MySQL server, you will probably be frustrated with the following error,

           Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

The secret sauce to solve this problem is to connect to your MySQL using an IP address (to force TCP/IP) rather than the default socket-based connection initiated by using localhost.

Simply change the following line in your Rails config/database.yml from,

  host: localhost

to

  host: 127.0.0.1