This is a follow up post to my blog on enabling and disabling the MySQL slow query log without restarting MySQL. In this post I’ll explain some methods for analyzing and parsing information out of the MySQL slow query log and then optimizing the slow queries. The slow query log is an absolute mess. Go ahead just open it and you will see what I mean…
Posts Tagged ‘Linux’
MySQL Slow Query Log – Analyzing, Parsing, and Optimizing Slow Queries
Creating a Spider with Python Mechanize to Monitor Your Website
Every since the SeoMoz conference in Seattle I’ve been wanting to write a spider to do some of the interesting things the speakers mentioned. Well I haven’t gotten an opportunity to write any SEO apps yet, but I did get a chance to take my first crack at Python using the Mechanize spider. Mechanize is fast and light-weight parsing large HTML documents in fractions of a second. There were PHP options I could have used. One was phpdig. I could have also written a spider from scratch. But after 4 years of developing in PHP I wanted to try something new. Enter python + mechanize for monitoring websites.
The opportunity came after some unfortunate circumstances lead to downtime at work related to a data center migration. Needing a way to go beyond simple service monitoring for things like HTTP/Apache and MySQL I built upon mechanize to test for specific HTML tags within the document body.
Using perror to Help Debug Mysql Errors
Print a description for a system error code or an error code from a MyISAM/ISAM/BDB table handler. Example, type “perror 150″ in the linux shell.
1 2 | # perror 150 MySQL error code 150: Foreign key constraint is incorrectly formed |