I have 4 API endpoints build in NodeJS, and deployed in GCP Cloud using docker image of the application which is as below:
My application, hits separate APIs, returns response and saves data in Cloud SQL.
FROM node:12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
# Copy local code to the container image.
COPY . ./
# Run the web service on container startup.
CMD [ "node", "app.js" ]
1 API takes around 1 min to return response and I get successful response back when trying from Postman and hitting the Cloud run URL
other 3 APIs takes 2 mins and other 20mins each to return response back and till that time I get error from Cloud run
503 Service Unavailable
takes: 2 m 1.02 s
478 B
Below are the configuration given :
Memory allocated: 8 GB
CPU allocated: 4
Maximum request per container: 20
Request timeout: 3600 seconds
NOTE: I am only hitting one request at a time
What can be the problem ? I increased concurrency but that didn't work. For my application in Cloud Function service won't work as timeouts is 9 mins.
Which service I can use in GCP for this kind of work?