I have a spring-boot application that uses Java on the backend and react.js on the frontend side. Some API calls are too slow in the production environment (it takes 1 min in the production environment and 4 ms in the local). The slow APIs are not fetching any large data set. I was trying to debug the code and found Nginx error logs. The logs are as follows:
[error] 29755#29755: *632803 upstream timed out (110: Connection timed out) while connecting to upstream, client: 172.XX.X.XX, server: test.apps.com, request: "GET /apiv1/master/modules?&isglobal=all&startIndex=0&pageSize=10&sortBy=id HTTP/1.1", upstream: "https://172.XX.X.XX:443/mhk-cmt-app/master/modules?&isglobal=all&startIndex=0&pageSize=10&sortBy=id", host: "test.apps.com", referrer: "https://test.apps.com/admin/app-setting"
How can I improve the API response time in production?