We need help repairing two SMS scripts. The problem with each script is explained below:
We have a script that uses the “GET” method and allows us to receive and reply to SMS messages. We have noticed in the last few weeks that if an SMS message arrives and we do not respond to it in 4-5 minutes it disappears completely without any trace. We are therefore loosing or unable to reply to dozens of SMS daily. We urgently need this problem fixed.
We have a script that sends bulk SMS. The script is feed by a large database of 2.5 GB. The size of the database is causing the script to execute very slowly. Our Hosting provider has suggested a number of solutions as indicated below.
(Suggestions from Host)
The simple answer is that you need to either reduce the size of your database or you would need to move your database to a different server. The best option I see would be to truncate the queue table periodically. It is currently over 62 million rows in size. If you need to maintain the information for historical purposes, you can always dump the table into a file or another database, and then truncate the table. With a smaller table, the update queries should run much faster and the scripts will execute more quickly. This will prevent them from stacking. In the long term, you may want to look into having your developer write your SMS delivery script to run as a single daemon, so that way dozens and dozens of instances of a single script that stack up. This would reduce the memory usage from your deliveries, keeping the server more stable and shouldn't sacrifice performance.
(Preferred Solution for Problem 2)
We want to fix problem 2 using the most reliable method. We do not want to reduce the size of our database, however we understand that the large size is what is causing the problem. Kindly come up with the best solution to fix this problem.