php - How to increase my codeigniter application performance?

I have an codeigniter application which constantly gets data from the web-socket connected using node Js
So the node will get the data from the web-socket and pass it the codeigniter application function and this function will insert the data first in the MySQL database and then redirect to another function this function will process the inserted data and then redirect to another function and this function will send the processed data to the API
So roughly my controller will look like this
function data_from_node(){
// code to insert the data from node into database
redirect('my_controller/data_process');
}
function data_process(){
// code to process the inserted data
redirect('my_controller/send_to_api');
}
function send_to_api(){
// code to send the processed data to the API
}
For one process there will be almost 200 data will be coming from the node and the whole process should complete with 5 -6 mins, This is working perfectly when there is less data in the MySQL database,when the data in the database is increasing the application is getting slower and it takes around 10 mins to complete a single process
Can anyone help me with a solution to increase a performance of my application, The process should take only 5-6 mins even though there are millions of records in the database.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: foreach() argument must be of type array|object, null given
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.