I have Rest api built on Codeigniter (PHP 5.5 - MYSQLi 5.6). 8 queries fired for a single Api call. The connection increases on calling other api's and connection doesn't reduce at all.
For 4 users the queries and connections were increased to 25-32. I wonder how to reduce the connection & Queries.
I have this scenario - MY_MODEL extends CI_MODEL and USER_DB extends MY_MODEL and USER_MODEL extedning the User_DB. I suspect any problem in constructor chaining. Please suggest
pconnect is true in your case, that is, your settings are to use a persistent connection. In this case, whenever you create a new connection, the number of connections is increased. You need to close the connection in this case. You can set pconnect to false as well, but you need to think about it before you do it. You might need a persistent connections in some scenarios. See here:
Advantages / Disadvantages of pconnect option in CodeIgniter