High CPU usage in the application where Spring Batch is implemented

Viewed 184

I encountered a problem when the program with Spring Batch framework uses a lot of CPU. In general. I implemented a simple service for sending SMS, it was implemented with the integration of a specific provider. The provider can only support 50 SMS per minute. We shouldn't lose any SMS messages, so the decision was to implement Spring Batch in our app. If the provider returns a specific error response, we going to save the request to the mongo database with the status PROCESSING_REQUIRED. Every 10 minutes the application with Spring Batch reads the data, and if a record with the appropriate status is found, we will send an SMS to the user again. We deployed the application in some environment and I tested CPU usage for one week. In the first 3 days of CPU usage did not exceed 30% every 10 minutes when the job was triggered. But a week later, I reviewed CPU usage again and noticed that usage had increased to 80% every 10 minutes when cron was triggered. One more piece of information I have to say is that there were no records for processing with the status PROCESSING_REQUIRED, because we did not exceed the required limit during testing. If anyone can help me, I will be very grateful.

0 Answers
Related