Improving Performance With MySQLi And APC

floris

Habitué
Joined
Jan 17, 2004
Messages
1,342
vB Floris submitted a new Article:

Improving Performance With MySQLi And APC

This article is not tailored at just vBulletin, other forum and blog softwares out there can also improve their performance by considering using caching modules and MySQLi. And, applies to all linux distributions, paths and package manages might vary.

Written for Linux CentOS 5, vBulletin 3, MySQL5.

This article is written by me, and originally published on my blog here: MySQLi | MrFloris and Installing APC on CentOS 5 Server | MrFloris

MySQLi

With MySQL v3 out of the way, and MySQL 4 and 5 being used everywhere now (and if you have not upgraded to the latest stable .. shame on you) I think it is time to point out that you can use MySQLi for your code, software and sites.

This article is to inform you about MySQLi and give you information so you can decide to upgrade and if you have already to perhaps use it on your vBulletin installation.

More information about MySQLi can be found here: PHP: Mysqli - Manual and MySQL :: MySQL 5.0 Reference Manual :: 20.9.7 Enabling Both mysql and mysqli in PHP

Using MySQLi with vBulletin might not give you huge benefits, but I have it turned on for my setups.

Some of the benefits of using MySQLi (improved) are:
- support for transactions for the storage engine InnoDB (autocommit, commit and rollback)
- prepared statements
- secure mysql connections
- multi query
- object oriented interface

More details about these benefits can be found here: http://www.charlesrowe.com/2007/06/15/the-four-major-benefits-of-mysqli/

And to save time heres a great article for experienced developers: ext/mysqli: Part I - Overview and Prepared Statements

In regards to vBulletin, once you check phpinfo(); and see you can use MySQLi you can go to your config.php file and set $config['Database']['dbtype'] to mysqli, default is mysql.

$config['Database']['dbtype'] = 'mysqli';

And if your tables and HTML charset are set to UTF-8 you can also set $config['Mysqli']['charset'] to utf8, default is uncommented. And $config['Mysqli']['ini_file'] to , default is .

$config['Mysqli']['charset'] = 'utf8';
$config['Mysqli']['ini_file'] = '';

Again, I...

Read more about this article here...
 
Last edited by a moderator:
Top