It's not a bug, it's a missing feature. bugs.TYPO3.org

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006180 [- TYPO3 Core -] Database API feature always 20.08.07 22:29 29.08.07 09:48
Reporter Marcel Alburg View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.1.2
Summary 0006180: Round Robin for native MySQL SELECT queries
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.
Additional Information ----
$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'
);
----
Tags No tags attached.
Has patch yes
Patch is reviewed
PHP Version 5.2
TYPO3 Version 4.1
Attached Files ? file icon round_robin_mysql_select.diff [^] (2,641 bytes) 20.08.07 22:29

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0015430)
Oliver Hader (administrator)
21.08.07 17:29

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! :-)
(0015431)
Marcel Alburg (reporter)
21.08.07 17:38

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
(0015541)
Martin Kutschker (developer)
28.08.07 17:08

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.
(0015553)
Marcel Alburg (reporter)
29.08.07 08:19

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
(0015554)
Martin Kutschker (developer)
29.08.07 09:19

I have written that I want an extra extension, not a Core inclusion (neither in t3lib_db directly nor in DBAL).
(0015555)
Marcel Alburg (reporter)
29.08.07 09:48

Ahh ok :).

But that, we need a Hook in for the Core.

- Issue History
Date Modified Username Field Change
20.08.07 22:29 Marcel Alburg New Issue
20.08.07 22:29 Marcel Alburg File Added: round_robin_mysql_select.diff
20.08.07 22:29 Marcel Alburg Has patch => yes
20.08.07 22:29 Marcel Alburg PHP Version => 5.2
20.08.07 22:29 Marcel Alburg TYPO3 Version => 4.1
21.08.07 17:29 Oliver Hader Note Added: 0015430
21.08.07 17:29 Oliver Hader Issue Monitored: Oliver Hader
21.08.07 17:31 Oliver Hader Summary Round Robin for nativ MySQL Select's in Typo3 => Round Robin for native MySQL SELECT queries
21.08.07 17:38 Marcel Alburg Note Added: 0015431
28.08.07 17:08 Martin Kutschker Note Added: 0015541
29.08.07 08:19 Marcel Alburg Note Added: 0015553
29.08.07 09:19 Martin Kutschker Note Added: 0015554
29.08.07 09:48 Marcel Alburg Note Added: 0015555
hosted by
bitfarmers TYPO3 Hosting
in case of Problems mail to:
service [at] bitfarmers [dot] com

Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker