This should probably be on the main MySQL list. I think I'd use the one minute load average from the servers (assuming they were all on the same OS/version), and cache it for a minute (you don't want your pings to add to the load). That is, if you don't need < 1minute resolution. The load is a good indicator since it will take into account the complexity of the queries running. With more resolution, nothing is very good, but almost anything will likely do, AFAIK.
BTW: Have you looked at: http://www.firstworks.com/sqlrelay.html "SQL Relay is a persistent database connection pooling, proxying and load balancing system for Unix and Linux supporting ODBC, Oracle, MySQL, mSQL, PostgreSQL, Sybase, MS SQL Server, IBM DB2, Interbase, Lago and SQLite with C, C++, Perl, Perl-DBD, Python, Python-DB, Zope, PHP, Ruby and Java APIs, command line clients, a GUI configuration tool and extensive documentation. The APIs support advanced database operations such as bind variables, multi-row fetches, client side result set caching and suspended transactions. It is ideal for speeding up database-driven web-based applications, accessing databases from unsupported platforms, migrating between databases, distributing access to replicated databases and throttling database access." Sincerely, Steven Roussey http://Network54.com/?pp=e > -----Original Message----- > From: Colin Faber [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 22, 2002 4:13 pm > To: [EMAIL PROTECTED] > Subject: Re: load formula > > Well; > > The reason for the question is; I'm thinking of writing a load balancing > system in C which will allow a central connection point; pool a list of > mysql servers, Then dump the incoming request off to the server with the > least amount of load, I know replication plans to solve this how ever, I > haven't seen anything aimed at having a centralized connection point for > the end user applications to connect to. > > Much like a BigIP system with load measurement for mysql. > > > > Steven Roussey wrote: > > > > > Does anyone here have any suggestions for writing up a `load formula' > > to > > > test on a numerical bases how much load any given mysql server is > > under? > > > > > > ie, queries per second / threads = load ... as a simple example. > > > > This is highly application (and configuration) specific. If both servers > > are doing identical work, then anything like the above (or better, find > > the number of queries in the last second) would work. The number has no > > meaning. > > > > Depending on HTTP Keep-Alive and your setup for connection pooling, the > > threads number can either be constant or the most important number. If > > we assumed the you are talking about a web server and not doing > > connection pooling (which is not such a great thing to do in PHP, for > > example) then the number of threads will be all you need. It will say > > how many queries are currently being processed on each server. > > > > BTW -- why not check the actual 1 minute load average on the servers? > > > > Sincerely, > > Steven Roussey > > http://Network54.com/?pp=e > > > > --------------------------------------------------------------------- > > Before posting, please check: > > http://www.mysql.com/manual.php (the manual) > > http://lists.mysql.com/ (the list archive) > > > > To request this thread, e-mail [EMAIL PROTECTED] > > To unsubscribe, e-mail <[EMAIL PROTECTED]> > > -- > Colin Faber > (303) 859-1491 > fpsn.net, Inc. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php