?

Log in

No account? Create an account

MySQL 6.0, Libevent

« previous entry | next entry »
Jan. 1st, 2008 | 11:30 am

Currently in the 6.0 tree we have support for Libevent. This is one of those things I've been wanting to see
us do for years and it was finally completed a few weeks ago by Damien
Katz (aka CouchDB) with some help from Dmitri Lenev.

So what does this do? MySQL uses a 1:1 ratio for connections and
threads. Libevent allows us to pull threads into pools and use them
for connections. This is pretty awesome for 8way machines since
partially solves thread contention issues. Below is an example of
MyISAM doing large number of inserts with the number of users doing
inserts increasing (1-300 users). The graph shows the time taken for
each test run. Similar numbers show up when you run benchmarks with
Innodb (leave concurrent set to zero as you should normally do, this
will allow libevent to more effectively control the thread usage).
The green line shows the test running with 20 threads, while the blue
is unlimited. I do not have good rules of thumb yet for thread number
vs processors. The machine I used for this test is an 8way that I have
on loan from Intel. I will work out a similar test for Solaris once I
can get the code to compile there.

Pretty awesome :)
Libevent Picture.jpg

Link | Leave a comment |

Comments {17}

libev would be nice[r]

from: rogerdpack
date: Jul. 5th, 2008 12:00 am (UTC)
Link

libev support might be nice :)

I haven't looked at the new code too much, but noticed that it might have one outstanding DB query per thread in the pool.
I assume this is pools running on the server itself? So it basically limits the totally max_actively_being_run_queries?

Will the client get any libev/libevent support? That would be sweet, and possibly allow for a single client thread to do multiple simultaneous queries to the database. If I'm understanding it correctly, anyway.

Client-side support that was this way might fit nicely in with my own work of single threaded web servers.[1]
Just thinking out loud.
Thanks for doing that stuff!
-R
[1] http://betterlogic.com/roger/?p=339

Reply | Thread

Brian "Krow" Aker

Re: libev would be nice[r]

from: krow
date: Jul. 5th, 2008 12:04 am (UTC)
Link

At some point I will look at libev, but so far no one has done this in any of the communities I belong too. From my understanding of the library libev can emulate libevent so I don't see why someone couldn't take the server and do a side by side comparison.

Reply | Parent | Thread

Re: libev would be nice[r]

from: anonymous
date: Mar. 30th, 2009 08:01 pm (UTC)
Link

eBay spearheaded having event ports / pool of threads support in their own custom build of MySQL enterprise about 2 years ago with their donation of a sample implementation (developed by Igor Chernyshev), which MySQL productionalized the implementation and eBay has been running for over 1.5 years now. What is different about the implementation in 6.0 with what MySQL has worked on with eBay?

Reply | Parent | Thread

Brian "Krow" Aker

Re: libev would be nice[r]

from: krow
date: Mar. 30th, 2009 08:04 pm (UTC)
Link

EBay's version used a specific Solaris call, while the version in MySQL/Drizzle uses libevents. We will be introducing the Solaris one when we get a chance.

Reply | Parent | Thread