DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: QForms

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:falcifer
Changed:2008-05-21T23:32:15
Email:lars@quitsch.org
Info 2:
Info 3:
Info 4:

t3p_scalable

Extension Key: t3p_scalabe

Copyright 2008, Fernando Arconada, <fernando.arconada at gmail dot com>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

t3p_scalable 1

Introduction 1

What does it do? 1

Highlights 1

Installation 1

Configuration 2

FAQ 3

Known problems 3

To-Do list 3

Changelog 3

Introduction

What does it do?

t3p_scalable is a powerful designed extension with the idea to get a TYPO3 to be able to adapt its architecture in scenarios of heavy load. So with this extension you will be able to use MySQL replication and Memcached in transparently or semi-transparently way

Highlights

Memcached

  • MySQL replication to spread DML and DQL queries
  • You can choose between servers in a balanced algorithm

Installation

For installation you need to install the given t3x file. You can either copy the extension directory in your typo3conf/ext/ root, or upload it with the install and import mask of typo3.

VERY IMPORTANT: To complete the installation you need to replace the file t3lib/class.t3lib_userauth.php with the file with the same name that you could get inside the directory of this extension. The provided file only changes one line in function fetchUserSession(), so you could change it with a text editor if you want.

After the installation you have to configure the extension manually in typo3conf/localconf.php

Configuration

Example of configuration array in localconf.php.

The array should be named $t3p_scalable_conf. Its very important to disable persistent connections to MySQL.

Database configuration

In this example you have a MySQL architecture ('db' section) with 1 master host that will be the target of your data modification queries. This Master host its the default TYPO3 database host (array('host'=>$t ypo_db_host,'port'=>3306,'user'=>$typo_db_username,'pass'=>''))

you could add more hosts if you have a multimaster MySQL.

Also you have 2 slaves (replications slaves) MySQL hosts: the default TYPO3 host and other '192.168.1.56'. This second server could be elected 3 times more than the first one. The slaves servers will be the targets of SELECT queries

VERY IMORTANT: databasename have to be same in all database servers.

Memcached configuration

The configuration of server works in the same way as in database servers.

I you set 'defaultTryMemcached'=>TRUEthen all of your SELECT queries will try to use memcached at less you add a flag to your exec_SELECTqueryto avoid it.

Now the exec_SELECTqueryhave this signature: exec_SELECTquery($selec t_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit=' ',$tryMemcached='')to give more control to developers.

If you set $tryMemcached=FALSEthen query wont be stored in memcached.

If you set $tryMemcached=TRUEthen query will be stored in memcached.

If you dont set $tryMemcachedthe deault action 'defaultTryMemcached'=>TRUEits considered

/**********************************************************************************

* TYPO3 SCLABLE EXTENSION CONFIGURATION

* BEGIN

*********************************** *********************************** ************/

$t3p_scalable_conf=array(

'db'=>array(

'readAttempts'=>1, // attemps if connection fails

'writeAttempts'=>1, // attemps if connection fails

'write'=>array(

array('host'=>$typo_db_host,'port'=>3306,'user'=>$typo_db_username ,'pass'=>''),

),

'read'=>array(

array('host'=>$typo_db_host,'port'=>3306,'user'=>$typo_db_username ,'pass'=>''),

array('host'=>'192.168.1.56','port'=>3306,'user'=>'root','pass'=>'','w eight'=>3),

),

),

'memcached'=>array(

'keyPrefix'=>'myDomain-', // key prefix to avooid key collisions

'objectTimeout'=>300, //Objects timeout (seconds) in cache

'queryGenerationTime' => 5, //max (aprox) query generation time in seconds

'compressed'=>MEMCACHE_COMPRESSED, // use memcached compression

'connectionAttempts'=>1, // attemps if connection fails

'enabled'=>TRUE,

'defaultTryMemcached'=>TRUE,

'firstLocalhost'=>TRUE, // should I try first in 'localhost' memcached server?

'servers'=>array(

array('host'=>'localhost','port'=>11211),

array('host'=>'192.168.1.5','port'=>1100,'weight'=>2),

),

),

);

$TYPO3_CONF_VARS['SYS']['no_pconnect']=1;

/**********************************************************************************

* TYPO3 SCLABLE EXTENSION CONFIGURATION

* END

*********************************** *********************************** ************/

FAQ

- No Questions

Known problems

I have to disable memcached in backend

To-Do list

  • Improve the code
  • Improve the manual
  • Increase the cache HIT ratio

Changelog

  • 1.1.0
    • If memcached server goes down or if TYPO3 cant connect to memcached server the PHP script disables the use of memcache.
    • You could use the same memcached server with serveral applications, now there isnt key collisions
  • 1.0
    • lots of bugs fixed
    • change in installation method
    • much more tested with jmeter
    • database distribution its now stable
    • dog-pile effect avoided
    • One more config option 'queryGenerationTime' to avoid dog-pile effect

img-1 Mailform