CodeIgniter Forums
CI 3.0.6 and MaxScale - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: CI 3.0.6 and MaxScale (/showthread.php?tid=68877)



CI 3.0.6 and MaxScale - tibon - 09-07-2017

Hello,

I'm facing an odd issue, my setup is as the following:
MaxScale -> Master -> Slaves (MariaDB 10.2)

Once the CI server is live and the users are starting to send requests the MaxScale is getting spammed with tons of connections and getting maxed out(from 100 connections to 3000).

I've then tried to make a direct connection from the CI to the master, the connection problem disappeared and everything went back to normal(around 150 connections) so the issue only appear when the CI is connected to the MaxScale.

The exact same MaxScale server is being used by other PHP frameworks with different DB class and everything is working perfectly(not sure if it's allowed to mention which but 2 popular frameworks without persistent connections).

Do you have an idea of what can be the cause that CI spams the MaxScale with connections but not the Master?

Thanks in advance.


RE: CI 3.0.6 and MaxScale - bartje1974 - 09-07-2017

I don't know anything aboute MaxScale, but if you use /application/config/database.php, in the config array:
set the option 'pconnect' => TRUE to FALSE. That should by default.

Other solution is maybe not to autoload the database, only when you need.
You can do something like $this->load->database()


RE: CI 3.0.6 and MaxScale - tibon - 09-08-2017

(09-07-2017, 10:46 PM)bartje1974 Wrote: I don't know anything aboute MaxScale, but if you use /application/config/database.php,  in the config array:
set the option 'pconnect' => TRUE to FALSE. That should by default.

Other solution is maybe not to autoload the database, only when you need.
You can do something like $this->load->database()

Yeah, the pconnect is set to FALSE.
As for the autoload, I would prefer to try different sql proxy before making such a huge change. Something doesn't add up in here.