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
- The connection & queries are increasing rapidly.
- Have used Persistent connection in Config file no use.
- How to reduce the mysqli connections & queries fired.
- Do i have to forcibly close the connection after every api call or should i leave it to Codeigniter.