| Subcribe via RSS

Omni[My]SQL 0.0.5 Released

July 30th, 2008 | 1 Comment | Posted in MySQL, OmniMySQL, OmniSQL

The OmniMySQL project is now officially known as OmniSQL (for obvious potential legal reasons). I find myself using this tool more and more, so I thought it was about time to add some new features. The new project download site is now http://code.google.com/p/omnisql/. Let me know of any bugs and/or enhancements!

CHANGELOG:

0.0.5 - 30 July 2008

- Added the --list-groups command-line option
- Updated Documentation
- Added a version check on startup
- Changed the project name to OmniSQL
- Added support for piping commands through STDIN

Tags: , , ,

MySQL RSS Feeds

July 18th, 2008 | 1 Comment | Posted in FreeBSD, MySQL

Issue Five of MySQL Magazine just came out and it included the results from its Annual MySQL Usage Survey. Among a bunch of other cool information, it asked the question: “What is your favorite blog?” (Q26). The results were as follows:

MySQL Magazine Survey: What is your favorite blog?

The first interesting thing that I noticed was that the #1 result (with 100 votes) is not an actual blog, but rather a domain owned by a squatter (current asking price is $2,000USD). I assume that they meant http://www.mysqlperformanceblog.com/. So, in the spirit of sharing favorite blogs, I have compiled a list of all of the MySQL-related RSS feeds that I follow regularly. The list is maintained here.

http://dammit.lt/ – domas mituzas: vaporware, inc.
http://izoratti.blogspot.com/ – Ivan Zoratti’s Blog (on MySQL)
http://jpipes.com/ – Jay Pipes
http://mysql-dba.com/ – The MySQL DBA Feed Resource
http://www.planetmysql.org/ – Planet MySQL
http://www.mysqlperformanceblog.com/ – MySQL Performance Blog
http://feeds.feedburner.com/techrepublic/datacenter – Servers and Storage
http://ramonspage.blogspot.com/ – Ramon’s Page (MySQL Cluster)
http://mysql-ha.com/ – High Availability MySQL
http://blogs.sun.com/carriergrademysql/ – MySQL in Communications Blog
http://blog.plasticfish.info/ – Jon Stephens
http://mikaelronstrom.blogspot.com/ – Mikael Ronstrom
http://jonasoreland.blogspot.com/ – Jonas Blog (MySQL Cluster)
http://www.bcs.org/server.php?show=ConBlog.5 – Johnny’s Data Migration Blog
http://johanandersson.blogspot.com/ – Johan Andersson’s Blog (High Availability MySQL)
http://blog.kovyrin.net/ – Homo-Adminus Blog
http://highscalability.com/ – High Scalability
http://database-programmer.blogspot.com/ – The Database Programmer
http://crazydba.blogspot.com/ – Crazy DBA
http://www.xaprb.com/ – Baron Schwartz
http://datacharmer.blogspot.com/ – The Data Charmer
http://krow.livejournal.com/ – Brian Aker
http://www.jpipes.com/ – Jay Pipes
http://www.pythian.com/blogs/ – Pythian
http://jcole.us/blog/ – Jeremy Cole
http://www.pablowe.net/ – My Blog:)
http://www.honeysoftware.it/sleto/blog/ – Yabomsat! (Yet Another Blog On MySQL® Server Administration, monitoring and Tuning!)

MyMemCalc Version 0.0.2 Released

July 7th, 2008 | No Comments | Posted in Memcached, MyMemCalc

MyMemCalc, a command-line utility for basic reporting on Memcached Performance for groups of memcached servers, version 0.0.2 has been released.

ChangeLog:

* Added the --quiet command-line option to not display raw numbers
* Output now also includes Memcache Fill Ratio

Tags: ,

Memcached

July 6th, 2008 | 1 Comment | Posted in Memcached, MyMemCalc

The other day I was watching a Memcached Webinar (“Memcached for MySQL: Advanced Use Cases”) sponsored by MySQL, and it got me thinking about memcached from an operational perspective.

It seems to me that the implementation patterns for memcached are fairly well codified in the standard body of knowledge. What does NOT appear to be in the standard BoK is how to build a supporting infrastructure behind memcached to ensure that it is an effective and reliable component of the application architecture.

I often work with clients who have implemented memcached and seen great improvements in page load times and database load averages. However, most users have not taken the time to set up a supporting infrastructure like they would for webservers, database servers, or other traditional apps. So, I thought I would take a minute to talk about the MINIMUM actions one should take to support their memcache installations:

MONITOR

At a bare minimum, Memcached should be monitored to see if the process is running. There are many Nagios Plug-Ins available:

check_memcached.py from NagiosExchange
check_memcached from CPAN

NOTE: Different checks have different capabilities … evaluate and test for your specific needs

GRAPHING

Having visual graphs is very useful for trending over time and providing at-a-glance metrics. Cacti is a great tool for such, and there are readily-available templates for Memcached:

Templates from DealNews
MySQL Server Templates from faemalia.net

For those whose organization cannot or will not support Cacti or Nagios, one can use simple scripts such as mymemcalc to gather basic Memcached performance statistics.

REDUNDANCY/FAILOVER

The two most important questions in the Memcached FAQ are:

1) How is Memcached Redundant? (It isn’t)
2) How Does Memcached Handle Failover? (It doesn’t)

The redundancy problem cannot be fixed, except to ensure that a single (or multiple) memcache server failure will not render the application unusable.

The failover problem can be solved in a couple of ways:

1) Have a “hot spare” host available that can manually be turned on (with the same IP of the dead server) in the event of failure. This approach is very common and inexpensive to implement.
2) Have an active-passive failover with heartbeat, and automatically failover to the passive in the event of the primary server failing. This approach is more expensive and less used, but can result in less cache downtime in the long run.

WARMUP SCRIPTS

Some implementations may require memcache flushes on occasion. If the application has come to rely on memcache, it is possible that this can criple it until memcache is sufficiently populated with data as to alleviate the database load. The simplest way to warm up a memcache pool is to simply load the most popular pages of your site by using a crawler such as mycachewarmer. The loading process should automatically take care of the caching process. More advanced setups may require more custom scripts.

NAMESPACES

As mentioned before, pushing new features may require memcache invalidation for cached items affected by the code change. For example, if MySpace were to update Bulletins, they would probably want to invalidate all cached bulletin information without affecting any other features on the site. The easiest way to do this would be to invalidate all keys beginning with BULLETIN_*, but Memcached does not support namespaces. There are some common tricks to fake them, however:

1) Simulate Namespaces With Key Prefixes. This approach is simple, but can result in additional traffic to the memcache servers.
2) Have the application use separate cache pools for each feature. Continuing with the MySpace example, there would be a separate cache pool for bulletins, mail, comments, media, friends, etc… Although this approach has potentially more points of failure, it can make the feature-release process less taxing on the system as a whole.

CONCLUSION

Memcached can significantly reduce database load and increase application scaleability. With a little planning, it can also be among the most reliable and fault-tolerant tiers of an application.

Tags: ,

Changing The Exit Message in MySQL Client

July 2nd, 2008 | No Comments | Posted in MySQL

Sheeri Kritzer Cabral sent out a tweet yesterday wishing she could change the default MySQL exit text from “Bye” to “kthxbai!”. I figured that it was something that could be quickly done using a pager, but that turned out not to work because it is written after the pager would have been called. So I started digging around the source and found the following line in client/mysql.cc (line 1233):

put_info(sig ? "Aborted" : "Bye", INFO_RESULT);

and changed it to:

put_info(sig ? "Aborted" : "kthxbai!", INFO_RESULT);

So, Sheeri, this patch is for you:)

qubert:client rlowe$ bzr diff mysql.cc
=== modified file 'client/mysql.cc'
--- client/mysql.cc 2008-06-25 09:44:55 +0000
+++ client/mysql.cc 2008-07-02 02:28:19 +0000
@@ -1230,7 +1230,7 @@

#endif
if (sig >= 0)
- put_info(sig ? "Aborted" : "Bye", INFO_RESULT);
+ put_info(sig ? "Aborted" : "kthxbai!", INFO_RESULT);
glob_buffer.free();
old_buffer.free();
processed_prompt.free();

Tags: