Feature #17544
closedRound Robin for native MySQL SELECT queries
0%
Description
I've create a Patch (just a proof-of-concept) to Cluster the Select Statements from Typo3.
You can enter in localconf.php multiple slave servers. This servers will be selected by rand(0, [amount of slave servers]). I add a "dead File" to disable a slave server (in case of emergency or planned downtime). This file must be remove by hand from admin.
It's possible to create this deadFile by hand (in case "out-of-sync" of the slave db servers).
In the backend, the normal master server will be used.
Proof-of-Concept
----
$TYPO3_CONF_VARS['SYS']['slave_db_handler'][] = array(
'typo3_db' => 'db',
'typo3_db_host' => 'slave01',
'typo3_db_password' => 'geheim',
'typo3_db_username' => 'user',
'dead_file' => 'typo3conf/slave01_db_dead'
);
$TYPO3_CONF_VARS['SYS']['slave_db_handler'][] = array(
'typo3_db' => 'db',
'typo3_db_host' => 'slave02',
'typo3_db_password' => 'geheim',
'typo3_db_username' => 'user',
'dead_file' => 'typo3conf/slave02_db_dead'
);
----
(issue imported from #M6180)
Files
Updated by Oliver Hader over 17 years ago
Hi Marcel,
I like the idea of load balancing, but there are some things missing in my point of view:- Maybe the balancer could be integrated to the system extension DBAL?
- If I got it right, each query might create and use a different connection. IMO it would be better to use the same connection (which is already opened) for one HTTP request to the website.
- Maybe there is a way, to find out the current load/opened connections on the remote database servers and use the remote system with the lowest load.
But since this is a proof-of-concept I doesn't have to be perfect on the first approach, but showing the possibilities/features. So, keep it up! :-)
Updated by Marcel Alburg over 17 years ago
Yes, i know. A patch for DBAL is my next project because i use PostgreSQL (and with PostgreSQL it's possible to balance the Select Statemants with an PGSQL Extension).
I add this just for discuss to know if it usefull to implement the Balancer Script in Typo3 Core.
Marcel
Updated by Martin Kutschker about 17 years ago
I don't think this should go into the Core. For Mysql I'd prefer a standalone extension like DBAL. For DBAL I'd like to see a seperate extnesion as well because DBAL is so bloated.
Updated by Marcel Alburg about 17 years ago
Hello
but the most of the typo3 users don't use DBAL. And if you use DBAL, you've a lower website generation speed.
In the next time, i'll write a patch for DBAL. But i think, it's important to discuss to accept this patch for the core.
Marcel
Updated by Martin Kutschker about 17 years ago
I have written that I want an extra extension, not a Core inclusion (neither in t3lib_db directly nor in DBAL).
Updated by Marcel Alburg about 17 years ago
Ahh ok :).
But that, we need a Hook in for the Core.
Updated by Klaus Hinum about 12 years ago
- Target version deleted (
0)
Any update on that issue, is there already a hook in the core. I see this one of the most important features for big T3 installations as it allows an easy way to cluster the DB.
It would be perfect to allow a write to many db and read to the specified. This way you could easily install more frontends.
Updated by Morton Jonuschat over 9 years ago
- Description updated (diff)
- Status changed from New to Rejected
After discussing this in #typo3-cms-coredev on Slack this is out of scope for the Core. It could be implemented by an extensions that extends the DatabaseConnection class the same way EXT:dbal does.