May 21, 2008

MySQL 5.1 - Thread Pool Support

Since few weeks I was working on patching the MySQL 5.1 with libevent support to have thread pooling in server end as it is needed by few properties where they do not need a persistent connection and needed to scale server with thousands of connections as each call just does a simple query execution by connecting and disconnecting and pooling seemed to be a right choice.

When I brought this idea to Monty; he pointed me to 6.0 where it is in preliminary stage. Now I took the same design and implemented in 5.1 to be compatible with how its working in 6.0; and things so far seems to be running fine, except few misc glitches that am trying to solve now.

It uses the same thread_handling=one-thread-per-connection (default) and new thread_handling=pool_of_threads and thread_pool_size controls how many will be initialized and kept at the startup.

| thread_handling            | pool-of-threads |
| thread_pool_size           | 5010            |

Few things that are missing from the 6.0 is the status of thread pools (number of threads currently in use, max used so far from pool etc) are all added now.

I am currently benchmarking the performance between the regular persistent to pool-of-threads model to see how it works out. I will post more details once I have the graphs and numbers along with working model.

May 8, 2008

Quick Look At Yahoo Messenger for Windows Vista

ymsg1 Recently Yahoo! released a new beta messenger (code name Diablo) for Windows Vista. Initially I tried during the alpha days and did not had a chance to try it again; and I installed it today during the free time and surprised to see that it offers almost all the existing features of regular messenger with much more enhancements.

The good thing about the new Diablo is;  it is completely re-written messenger on top of  Windows Presentation Foundation (WPF) for Vista to get the rich GUI look and feel. It has number of interesting features like zooming of contacts to the desired level, multiple color choice, searching of contacts, auto spell checker, phone support, call history etc. This is for sure much better than the currently existing one; and need to see what new features the team will add in the coming days especially towards the social networking of friends as part of YOS.

The only thing that I found missing is the archive of messages; that’s one of the feature that I use a lot by archiving all the messages; so that I can refer back to them at any time.

The screenshots of the messenger can be found from here:

[read more…]

Text Ads on SMS, Call To Free SMS service

Today I received a SMS message from evite for one of the birthday function. This is because my phone is configured with the evite account. The content is simple with 4 lines of text; which contains title, host, when and where. That is normal.

But I was surprised by the footer of the text message with the following line…

*Sponsored by The All-New Toyota Corolla

So, this seems to be a really cool idea; and we have to appreciate evite in order to incorporate the text ads as part of their SMS messages for evite invitations; this could generate some revenue for the company.

In India all incoming and outgoing SMS is free along with incoming calls, even though am not sure how mobile carriers are making money out there; but in USA that’s not the case even for SMS (some times its free as its part of the media packages).

Even in USA, it is possible for mobile carriers (like AT&T Cingular, Verizon and T-Mobile) to offer free SMS service to all end users by incorporating sponsored text or visual ads (if the phone can support media messages) as part of the message; that could be another adwords on Mobile SMS. Not only this offers a good revenue stream to the mobile carriers; but also can get more users to use the text or media message service as it will be free.

May 5, 2008

InnoDB not releasing a row lock?

This is a bit surprise when we encountered a case where InnoDB is not releasing its row lock when there is an error condition within the transaction. And I verified with Falcon, Oracle, SQL Server and Sybase; all seemed to work as expected.

For example; just open a transaction in a session and execute a error statement (lets say duplicate key) and on the other new session try to get a row lock on the same record (use where clause with FOR UPDATE) and you will notice that InnoDB blocks on this statement until you issue a explicit rollback or commit. But remember there is nothing happened on the first session other than duplicate error on that row. So, InnoDB should implicitly unlock the row when there is an error; and looks like it is not doing that.

Here is the scenario:

First create a single column table and populate some rows (lets say 20 rows in this case) on any version of MySQL/InnoDB.

mysql> create table t1(c1 int not null auto_increment primary key)Engine=InnoDB;
Query OK, 0 rows affected (0.14 sec)

mysql> insert into t1 values(),(),(),(),(),(),(),(),(),();
Query OK, 10 rows affected (0.12 sec)
Records: 10  Duplicates: 0  Warnings: 0

mysql> insert into t1 values(),(),(),(),(),(),(),(),(),();
Query OK, 10 rows affected (0.01 sec)
Records: 10  Duplicates: 0  Warnings: 0

and then execute the following statements; first in session-I and then in session-II and notice that session-II select statement hangs till you explicitly release the transaction in session-I.

Session-I Session-II
mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t1 values(10);
ERROR 1062 (23000): Duplicate entry ‘10′ for key ‘PRIMARY’

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from t1 where c1=10 for update;

Even though am not really sure whether this is a bug or feature in InnoDB (I suspect this as a bug); but Oracle, SQL Server or Sybase will not block the select and releases the lock on the duplicate error. Even Falcon engine in MySQL 6.0 does seem to release the lock appropriately.

May 4, 2008

Article on InnoDB Plugin

Last week I wrote an article on InnoDB plugin, which explains how to explore all the new features in the plugin along with comparing different row formats.

The article is live now from here:
http://www.innodb.com/wp/wp-content/uploads/2008/05/venu-anuganti-article-april-29-2008.html

Thanks to Ken Jacobs, who took the initiative to post the article on the web site.

Update: here is the nicely formatted version:

http://venublog.com/exploring-new-features-in-innodb-plugin-10/