We offer outstanding professional Joomla!TM extensions.

Professional Joomla! Extensions

Professional Joomla! Extensions

Blog Speed-up Joomla! - store sessions in memory

Newsletter

Enter your email address:



Delivered by FeedBurner

Latest on Forum

Member Login



Forum Tags


Advanced search
Speed-up Joomla! - store sessions in memory
Monday, 09 February 2009 13:02

Joomla! has the ability to choose the session storage method: none (file), APC, database, EAccelerator, Memcache and XCache storage handlers are possible. But in fact Joomla! still stores sessions data in the database and performs 3 SQL queries per each page load even if caching is On and session storage is not "database'.

How can we fix this issue and reduce the MySQL load?

jos_session table is stored using MyISAM storage engine - let's store this table in memory using MEMORY storage engine!

First we need to change the type of data field becuase MEMORY storage engine doesn't support BLOB/TEXT columns:

ALTER TABLE `jos_session` CHANGE `data` `data` VARCHAR( 5000 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL


5000 chars is usually enough to handle the session data, you can either setup more if having problems (can't login) or setup it to 0 if your Joomla session storage method is not "database".

Now let's change the engine:

ALTER TABLE `jos_session` TYPE = memory


MEMORY MySQL storage is much more faster than MyISAM. The only thing is that sessions will be lost if the server is down - but in 99.9999999999999999999% you don't need to take care about this, the users will just re-login.

All these operations can be easily performed in phpMyAdmin.

Besides in most sites jos_session table usually has overhead and requires optimization - MEMORY storage will help to prevent this.

Overhead may lead in database corruption and you won't be even able to login in Backend, that's why you need to optimize the MySQL tables and especially jos_session regularly.

 
 
Copyright © 2008-2012 Blogomunity.com
Trademarks and tradenames used herein are the property of their respective holders.
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. Blogomunity is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.