Thursday, March 26, 2009

Libmysqld performance. And a Webinar. And a talk at the UC!

As you might know by now, libmysqld, the deeply embedded version of MySQL, has reapperared in MySQL 5.1, having been gone in version 5.0. If you are curious about libmysqld in general, then feel free to pop by this free live webinar, hosted by noone else but yours truly:
http://www.mysql.com/news-and-events/web-seminars/index.html
(Look for the webex with the ISV and OEM ... Deeply embedded blurb, and you''ll find it). You need to preregister for it.

What I was going to say a few words about here though, was on the performance of libmysqld. The code in libmysqld is the same as in the mysqld server, basically, but there are some shortcuts, and above all, there is no overhead of Client / Server communication. I decided to try this out a bit, using a very simple application, doing INSERT, UPDATE and SELECT on a simple MyISAM table. Note that as the overhead of MyISAM itself is so small, the performance benefits here will be larger, in terms of percentage, than with, say, InnoDB. This doesn't mean I think there is something wrong with InnoDB (if you know me, you know this isn't my intention), just that I have choosen a setup to prove a point. The table I am using looks like this:
CREATE TABLE tab1(c1 INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
c2 CHAR(255),
c3 CHAR(255),
c4 CHAR(255),
c5 CHAR(255),
c6 INTEGER
) ENGINE=MyISAM;


Simple enough, right? So first I'm doing, using an empty table, 300.000 INSERTs, as 3 runs of 100.000 INSERT operations. Then I do the same thing with 400.000 UPDATEs, and I finish up with 300.000 SELECTs. I do this using embedded server, and the I restart and do the same thing using normal MySQL Client / Server. The numbers below is the mean time for 100.000 operations of each type.

EMBEDDED CLIENT/SERVER
INSERT 6.82 s 20.91 s
UPDATE 6.54 s 21.59 s
SELECT 6.92 s 21.73 s

Looking at the results in the table above, it looks like libmysqld is about 3 times as fast as mysqld. Can that be true? And the answer is no, it's not. Although the server and the libmysqld application are configured in the same way, run on the same hardware, and even use the same physical database, this is not a fair comparison. The reason is that what I am doing here are VERY simple operations, where the client / server overhead is significant. For more complex things, you will not see these differences, not at all. And note that libmysqld also has some disadvantages.

So, now I guess you ask yourself what in heavens name I have been smoking? What is my point? Really! And my point is this: For a singel user application, of low or medium complexity, the gain of using libmysqld isn't better performance, in and of itself (voice from the crowd: Can someone stop him. He's doing it again! Tell him to get to the point for heavens sake!). No, my point is that to achieve the same level of performance, less hardware resources is needed. And that IS an advantage. Right?

So no, performance isn't the thing, less overhead IS. To finish up, just a few more things: The benchmark, if that is what it should be called, above, was run on a small AMD 64-bit 2 core box running Linux (Fedora), and the application was a C-app using the MySQL C API, and MySQL version 5.1.32. And by the way folks, if you have been reading this far, welcome to my libmysqld talk at the MySQL User Conference which is up April 20 - 23.

And then, one big question remains: Where did I find that picture of myself that is on the MySQL UC website. Gosh!

/Karlsson
PS. My facebook and myspace pictures are better!
PPS. If you come to the UC and want me to wear a western style hat during the talk, tell me so. If you come to the UC only because of this, I owe you a beer!

9 comments:

Roland Bouman said...

Hi!

I have not messed much with embedded db's - just SQLite here and there. What I really like about that is that i can simply grab a file, send it through the mail or grab it with ftp, drop it on the target et voila, everything works.

Is this possible with embedded MySQL?

arjenAU said...

@Roland you can do that with MyISAM tables of course, but it's more than one file as you know.

I frankly don't see the point of libmysqld, it's pretty big. It's like a solution looking for a problem, but that space has been thoroughly taken by SQLite.
So why bother, SQLite rocks for that market.
Also, implementators will prefer the SQLite licensing (it's public domain!)

@Anders any other practical uses you can think of?

Karlsson said...

Things I like about libmysqld? Well, is uses the standard MySQL API (in difference to SQLLite), it is a supported solution (unlike SQL Lite), it use the same fileformat as mysqld (which means files can be "shared"), and actually, it's pretty lightweight.
Libmysqld is great for applications that "included" database as part of the application. Catalogs on CD and POS systems are two examples, but there are many more.

star said...

和歌山 デリヘル
神戸 デリヘル
姫路 デリヘル
大阪 デリヘル
京都 デリヘル
奈良 デリヘル
大阪 デリヘル
神戸 デリヘル
和歌山 デリヘル
奈良 デリヘル
京都 デリヘル
神戸 デリヘル
姫路 デリヘル
和歌山 デリヘル
奈良 デリヘル
京都 デリヘル
大阪 デリヘル
南大阪 デリヘル
大阪 デリヘル

star said...

和歌山 デリヘル
神戸 デリヘル
姫路 デリヘル
大阪 デリヘル
京都 デリヘル
奈良 デリヘル
大阪 デリヘル
神戸 デリヘル
和歌山 デリヘル
奈良 デリヘル
京都 デリヘル
神戸 デリヘル
姫路 デリヘル
和歌山 デリヘル
奈良 デリヘル
京都 デリヘル
大阪 デリヘル
南大阪 デリヘル
大阪 デリヘル

star said...

サイト制作
ドレス レンタル
アートメイク
アパレル
アロマセラピー
恵比寿 メンズエステ
恵比寿 エステ
ダイエット クエン酸
レストラン ウェディング
ランコム
エスティローダー
ルナソル
神社
建設機械レンタル
ワイン
シャンパン
ダイエット 方法

star said...

風俗
デリヘル
風俗
デリヘル 風俗
エロゲー
ソープランド
吉原 ソープランド
出会い
出会い
デリヘル
すすきの ソープランド
新宿 ソープランド
千葉 ソープランド
埼玉 ソープランド
神奈川 ソープランド
吉原 ソープランド
sod
バイブ
風俗求人 高収入
都内 キャバクラ 全額日払い
無料動画
大阪 風俗
大阪 風俗
神戸 風俗
裏DVD
裏DVD
風俗 求人
風俗 求人
デリヘル 新宿
デリヘル 東京
千代田区 デリヘル
台東区 デリヘル
墨田区 デリヘル
中央区 デリヘル

かこちん said...

炭酸水

海外ドラマ
イス
海の生き物
照明
お菓子
パン
健康

鳥類

山下 said...

錦糸町回春性感マッサージ倶楽部
外国人が利用できる風俗
女性は日本人限定
http://www.kk-kinshicho.net/