I want to know how I can decrease my loading time. I have debugged my PHP and the one thing that is taking its time is database connecting, my website currently takes 1.10 - 1.20 seconds average, and database connecting takes up more than 60% of that time. What I should do?
Is MySQLi faster than PDO? or what is the fastest mysql database driver... I don't really want PDO just for its features, I just do basic querying that can all be done in MySQLi also, but is MySQLi originally faster than pdo in connecting and doing querys?
Or is there an even faster driver than pdo or mysqli? Just a quick question really, not much information to go on, here is my pdo connecting file that I use, I think it is using one of the fastest ways to connect. How long should pdo even be taking to load? I want to aim for 500 - 800 milleseconds
// PDO Connection
try {
$dns = "mysql:host=*******;dbname=****";
$pdo = new PDO($dns, '******', '******');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $ex) {
exit('Unable to connect to the master database!');
}
I am using XAMPP as a web host, and also using my own server (a VPS) Windows 2012 R2 with MySQL community server.