I'm experimenting with using ConnectorJ 3.1.7 to connect to MySQL slaves to handle load balancing queries.

The environment would either include a hardware loadbalancer or round robin DNS (or static configuration). The main component though is having the JDBC driver continually reconnect (to actually balance the load)

The major problem is that we run a LOT of small queries to generate our pages so per-query latency is very important.

After benchmarking continual reconnect to my laptop running MySQL 4.1.9 and with our DB connection pool I'm noticing a 14x performance gap (with manual reconnects still loosing).

Here are the results:

       // Total parse count: 1000
       // Total duration: 3173  milliseconds
       // Total avg duration: 3.173  milliseconds
       // Total per second: 315.15915
       // Testing method: test2
       // ----------------
       // Total parse count: 1000
       // Total duration: 217  milliseconds
       // Total avg duration: 0.217  milliseconds
       // Total per second: 4608.295

So with our DB pool each query only takes .217 ms but without it its taking 3.173 ms. This doesn't sound like much but if you multiply that by 1000x queries its significant and can seriously screw with total throughput.

I've also tried removing any queries and JUST connection (without a SELECT 1) test and it still takes 2.8ms.

Here's my JDBC connection string:

jdbc:mysql://127.0.0.1/mysql?useUnicode=true&characterEncoding=UTF-8&useOldUTF8Behavior=true&holdResultsOpenOverStatementClose=true&cacheServerConfiguration=true&elideSetAutoCommits=true

I've also increase thread_cache_size on the server and Thread_created is a static value. This only had a slight performance advantage.

Any ideas?

Kevin

--

Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod!
Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to