On Tue, Jun 03, 2003 at 03:18:07PM -0400, Kevin Murphy wrote: > If I have two computers running identical copies of the same READ-ONLY > database, is there a way of persuading AOLserver to load-balance > queries to them and/or to fail over from one to the other if the > current open connection goes down?
I have never heard of anyone doing specifically that. However, depending on exactly what you're trying to do, it could be pretty straightforward. All you really is an algorithm to do the load balancing (e.g., round robin), and some a proc in you AOLserver to implement that algorithm. For example, if for the ns_db API, just use your own my_ns_db function instead, which decides which database pool to REALLY use, round robining between the two, and calls ns_db to get the actual handle. Or if you're using the OpenACS db APi, get the code supporting multiple databases (via the -dbn switch) off the head (it will be released in OpenACS 5.0), and tweak it in similar ways. In that case, simplest way would probably to have define a my_db_which helper proc which maintains the round-robin state, and simply use it to decide what database to tell the -dbn switch to use. E.g., "db_foo -dbn [my_db_which foo]". But, is one front-end AOLserver is going to be able to handle all the load. Are you sure that's reasonable? If you really NEED to load-balance between two backend databases for load reasons, well, that argues that you have a *LOT* of load. And you're going to need more than one AOLserver - which may make all of the above more complicated. Or simpler. If you have multiple AOLservers, how is the load distributed to each of those? Does each AOLserver need to load-balance to the pool of dbs at all, or can each one simply use If you do need each AOLserver to load-balance to the dbs (for example, because different AOLservers are performing a different mix of functions), is running an independent copy of the load-balancing algorithm within each AOLserver going to be adequate, or you need to share information between AOLservers to get good balancing? Much more info is needed here. Tell us more about the actual problem you're trying to solve. Is there some reason you can't just aggressively cache data from a single database? If that db fails, you could still have some code in your AOLserver telling it to switch to using a different one. Frankly, if your database is really READ ONLY, I don't see why you'd need any load-balancing at all, barring truly unusual amounts of data (terabyte scale), really horrible queries, really tight response time requirements, a really crappy RDBMS, or some combination of those sorts of unusual conditions. Normally you see people with busy websites running one big-ish database box and several front-end AOLservers. (And that's read-write to the database, of course.) Far as I know, that should always be feasible up until you get to truly massive levels, at which point see Jim's old Digital City presentation for some of the things that found necessary for their particular application. The key here is to say more about the actual problem you're trying to solve... -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list: http://www.aolserver.com/listserv.html List information and options: http://listserv.aol.com/
