Announcing Palmist

Posted: May 14th, 2008 | Author: Daniel Higginbotham | Filed under: Projects, Rails |

A Handy Tool for Finding and Fixing MySQL Bottlenecks

Purpose: Help find and fix mysql bottlenecks in Ruby on Rails

Example (click to enlarge)

example

Features

  • Make it easy to work on one request at a time
  • Highlight duplicate queries
  • Show the time each query takes and total db time
  • Link to EXPLAIN
  • List general MySQL optimization tips

Example Workflow

  • Every night I get an email from pl_analyze showing which requests are taking the most time in the database on designerpages.com ’s production server
  • Locally, I start Designer Pages in development mode
  • I also start Palmist, making sure it’s configured to analzye Designer Page’s development log (note that you might want to run your web app in production mode because the MySQL behavior will be slightly different)
  • Locally, I navigate to the Designer Pages page which is spending a lot of time in the database
  • In Palmist, I “refresh” so that I can see that latest analysis of the page I just visited in Designer Pages
  • As I make changes to Designer Pages, I refresh Palmist to see what effect the changes have
Installation
  • Follow the instructions at http://nubyonrails.com/articles/a-hodel-3000-compliant-logger-for-the-rest-of-us to install a Hodel-3000 compliant logger on the site you want to examine
  • sudo gem install ruby-debug
  • git clone git://github.com/flyingma/palmist.git
  • cd palmist
  • Copy config/config.example.yml to config/config.yml (cp config/config.example.yml config/config.yml)
  • Modify config/config.yml and config/database.yml and create your database
  • Clear the log files you want to analyze if they’re huge and you don’t want palmist to take forever analyzing them
  • rake db:migrate
    • This will analyze the log of the site you specified in config.yml
    • The migration assumes that palmist’s database uses mysql
  • ./script/start_3001 to start Palmist on port 3001 in dev mode
  • To use palmist after clearing your log files, you should run rake remigrate
Harder, Better, Faster, Stronger

Google group

Mad props to Eric Hodel


13 Comments on “Announcing Palmist”

  1. 1 Levi McCallum said at 9:22 am on May 15th, 2008:

    Wow, very nice release, Daniel.

    I’ll be sure to try this with new projects.

  2. 2 Daniel Higginbotham said at 10:41 am on May 15th, 2008:

    Hey Levi, thanks! Nice to hear from you, too :)

  3. 3 links for 2008-05-16 « Mike Does Tech said at 7:37 pm on May 15th, 2008:

    […] Flying Machine Studios » Blog Archive » Announcing Palmist (tags: rubyonrails mysql optimization performance database) […]

  4. 4 links for 2008-05-16 | Libin Pan said at 1:36 am on May 16th, 2008:

    […] Flying Machine Studios » Blog Archive » Announcing Palmist Purpose: Help find and fix mysql bottlenecks in Ruby on Rails (tags: database mysql rails performance optimization ruby rubyonrails) […]

  5. 5 A Fresh Cup » Blog Archive » Double Shot #209 said at 6:12 am on May 16th, 2008:

    […] Palmist - Tool for finding and fixing MySQL bottlenecks in Rails applications. […]

  6. 6 Webiest : Links for May 18th said at 2:04 am on May 18th, 2008:

    […] Flying Machine Studios » Blog Archive » Announcing Palmist - # Make it easy to work on one request at a time # Highlight duplicate queries # Show the time each query takes and total db time # Link to EXPLAIN # List general MySQL optimization tips […]

  7. 7 Double Shot #209 | Developer Home said at 1:32 pm on May 23rd, 2008:

    […] Palmist - Tool for finding and fixing MySQL bottlenecks in Rails applications. […]

  8. 8 Elentins said at 9:34 am on May 23rd, 2009:

    emm.. 10x :)

  9. 9 Review Stars Anales said at 5:01 pm on June 28th, 2009:

    mm.. funny )

  10. 10 drunk college nude said at 11:26 pm on July 23rd, 2009:

    any news coming ?

  11. 11 секс знакомства геев said at 1:35 pm on December 17th, 2009:

    в конце концов: шикарно..

  12. 12 theommosy said at 9:24 am on January 9th, 2010:

    Уважаемые читатели. С Рождеством христовым хочется вас поздравить. Админу сайта отдельное пожелание-побольше читателей на блоге, креативных интересных статей и всего всего всего :)

  13. 13 theommosy said at 12:35 pm on January 10th, 2010:

    Хороший сайт. Так держать!!!


Leave a Reply