My code imports data from one database to another. To avoid server overhead, I'm importing 100 out of 100 records in each ajax. I noticed that in the first requests, it takes about 40ms, but as it sends more requests, the return time grows a lot to 80ms, 100ms to 400ms. I am using the mysql connection to the CodeIgniter framework; I'm also using, in a single part of the code, a mysqli connection from php, and closing it on every request. I do not understand why the number of requests is increasing, it will take longer. Is the CodeIgniter connection not closing as expected?