| Subcribe via RSS

Installing HandlerSocket on RHEL 6 + Percona-Server 5.5 in Five(ish) Easy Steps

As a followup to my previous post on installing HandlerSocket on CentOS 5 + Percona-Server 5.1, I’ve been asked to provide an updated HOWTO for RHEL 6 + Percona-Server 5.5. Although very similar to the original steps, there are some new traps (RHEL 6 comes with SELinux enabled) and there are some new ec2 gotchas!

More »

(More) Numbers Everyone Should Know

September 27th, 2011 | No Comments | Posted in Performance, Random Tech

By now, everybody should be aware of Jeff Dean’s Numbers Everyone Should Know:

L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 100 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 10,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Read 1 MB sequentially from network 10,000,000 ns
Read 1 MB sequentially from disk 30,000,000 ns
Send packet CA->Netherlands->CA 150,000,000 ns

But there are some additional numbers that should be readily available at the front of your mind:

Uptime Percentage Downtime (per year)
99% 87.6 hours
99.9% 8.76 hours
99.99% 52.56 minutes
99.999% (Five Nines) 5.26 minutes
99.9999% 31.5 seconds
99.99999% (Seven Nines) 3 seconds

For whatever reason, these numbers tend to surprise people. An additional consideration when deciding your high availability needs is that with each additional Nine, the cost of implementation and ongoing maintenance rises exponentially!

HandlerSocket execute_multi Curiosities

April 4th, 2011 | 1 Comment | Posted in HandlerSocket, InnoDB, MySQL, NoSQL, Random Tech

A post on the HandlerSocket-dev mailing list the other day got me thinking about the performance of MySQL’s IN() construct versus HandlerSocket’s execute_multi. So I started a little test, using MySQL 5.5 + HandlerSocket’s latest commits:

mysql> CREATE TABLE `test`.`t1` (
    ->   `id` int unsigned NOT NULL AUTO_INCREMENT,
    ->   `val` char(32) NOT NULL,
    ->   PRIMARY KEY (`id`)
    -> ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.00 sec)
 More »
Tags: , ,

HandlerSocket’s Secret Authentication Mechanism

March 31st, 2011 | No Comments | Posted in HandlerSocket, Random Tech, Security

Matt Ward made a comment on another blog post of mine informing me that HandlerSocket does, in fact, support authentication (committed 20 November 2010 in 43545662ddc23faa90ab). He mentions that it’s only plaintext (you’ve got to start somewhere, I suppose) and that it is undocumented, which explains why nobody knew about it. The purpose of this post is to document the functionality until it’s officially done.

More »

Tags:

HandlerSocket Edge Cases

March 28th, 2011 | No Comments | Posted in HandlerSocket, MySQL, Random Tech, Uncategorized

A couple of weeks ago at the San Francisco MySQL Meetup, I gave a talk on HandlerSocket and got a couple of questions that, while I thought I knew the answer, I had never actually verified by testing. So, for the attendees who asked, here are the questions and answers:
More »

Nagios Checks for HandlerSocket

February 11th, 2011 | 1 Comment | Posted in HandlerSocket, MySQL, Nagios, Random Tech, Uncategorized

I’ve written some new Nagios checks for HandlerSocket. check_handlersocket is a part of http://code.google.com/p/check-mysql-all/, and is meant to be called locally on the HandlerSocket server (usually via NRPE), but the perl-Net-HandlerSocket module must be installed. Feedback is welcome, usage is as follows:

More »

Tags: ,

Connecting to HandlerSocket with localhost vs. 127.0.0.1

Using Net::HandlerSocket, here are some fun numbers for a single connection (open & close).

More »

Installing HandlerSocket on CentOS 5 + Percona-Server in Five Easy Steps

January 6th, 2011 | 7 Comments | Posted in HandlerSocket, MySQL, NoSQL, Random Tech

I’ve been spending a lot of time working on HandlerSocket these days, so I’ll be posting tidbits on this a bit more frequently than in the past. This first post is a quick one to help people get a test environment up and running quickly so they can do their functional testing. The title is a bit of a misnomer, though, because HandlerSocket is already included in Percona-Server, so we’ll really just be enabling it.

More »

Tags: , , ,

Cassandra “Quick Install” on CentOS 5

March 23rd, 2010 | No Comments | Posted in Random Tech, Uncategorized

Cassandra is notoriously a pain to install on CentOS. So partially as documentation for myself, here are the “quick install” steps for getting Cassandra up and running. For explanation, see the official Cassandra documentation. I think the biggest reason this differs so significantly from other install guides out there is that I wanted it to work on RightScale (know issues w/Java) as well as CentOS 5.1-5.4. I can’t wait until I can get Cassandra from yum …..

# Generic tools needed to install. Note that this is significantly more
# than found in any docs, but I couldn't get things to build otherwise
yum -y install gcc-c++ make cmake python-devel bzip2-devel zlib-devel
yum -y install log4cpp-devel git git-core cronolog google-perftools-devel
yum -y install readline-devel ncurses-devel libtool autoconf expat
yum -y install libevent-devel flex byacc expat-devel

# Perl Modules for Thrift Install
yum -y install perl-Bit-Vector perl-Class-Accessor

# Ruby Install
yum -y install ruby rubygems ruby-devel rake

# 1.42.0 Boost C++ Libraries
# (must build manually because yum repos are too old)
cd /usr/local/src/
wget http://sourceforge.net/projects/boost/files/boost/1.43.0/boost_1_43_0.tar.gz/download
tar xvzf boost_1_43_0.tar.gz
cd boost_1_43_0
./bootstrap.sh
./bjam install

# Java Install
yum -y remove jpackage-utils
wget http://dev.centos.org/centos/5/testing/x86_64/RPMS/jpackage-utils-1.7.5-1jpp.1.el5.centos.noarch.rpm
rpm -ivh jpackage-utils-1.7.5-1jpp.1.el5.centos.noarch.rpm
yum -y install xml-commons-apis xml-commons-apis-javadoc ant
yum -y install java
yum -y install log4j jakarta-commons-logging jakarta-commons-lang
yum -y install java-1.4.2-gcj-compat java-1.4.2-gcj-compat-devel

# Install Thrift (link probably won't work)
cd /usr/local/src
wget http://www.poolsaboveground.com/apache/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
./configure && make && make install

# Get Cassandra: Authoritative link is http://incubator.apache.org/cassandra/
cd /usr/local
# Note this link will probably not work
wget http://apache.opensourceresources.org/cassandra/0.6.1/apache-cassandra-0.6.1-bin.tar.gz
tar xvzf apache-cassandra-0.6.1-bin.tar.gz
ln -s /usr/local/apache-cassandra-0.6.1 /usr/local/cassandra
useradd cassandra
mkdir -p /var/log/cassandra
chown cassandra /var/log/cassandra
mkdir -p /var/lib/cassandra
chown cassandra /var/lib/cassandra

# Put in place an init.d file
cd /etc/init.d/
# Taken from http://posulliv.com/2009/09/07/building-a-small-cassandra-cluster-for-testing-and-development.html
wget http://www.pablowe.net/cassandra
chmod +x cassandra
chkconfig --add cassandra
chkconfig --levels 2345 cassandra on

Tags:

HTTP Over SSL Best Practices

August 15th, 2009 | No Comments | Posted in Random Tech, Security

Encrypting connections to your web server using HTTPS is a trade-off between performance and security. Therefore, there’s no “right answer” for exactly what traffic to encrypt; it’s a business decision. There are, however, best practices that can guide you in the decision making process. In fact, there is a “golden rule” for making this decision:

If it were your session, would it bother you if I got the data? If your answer is yes, then the data should be encrypted!

More »

Tags: , ,