Hi,
We have a springboot backend app which takes in an excel file around 100 MB through REST call, parses the excel and stored in postgres db.
Now this backend app worked when we ran using sts in local. We used to call the api through postman and through UI and was returning a valid httpresponse back.The whole process will take atleast around 2.5 mins and above.
But when this app was deployed to Predix, while testing the API using Postman / UI, the backend springboot app wasnt sending any response back (neither to Postman nor to UI).
Is there any default timeout for https calls in predix? Also, PFB the manifest file regarding memory (have increased the memory to the below specifications else the app will crash) :
applications: - buildpack: java_buildpack memory: 5G disk_quota: 1G name: path: target/-1-SNAPSHOT.jar # services: # - env: MEMORY_LIMIT: 4G
PS : we want it as restful call itself. So dont require a websocket suggestion :)
Answer by Siva Balan · Aug 29, 2017 at 08:51 AM
Below is a snippet from AWS ELB documentation at http://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
By default, Elastic Load Balancing sets the idle timeout value to 60 seconds. Therefore, if the target doesn't send some data at least every 60 seconds while the request is in flight, the load balancer can close the front-end connection. To ensure that lengthy operations such as file uploads have time to complete, send at least 1 byte of data before each idle timeout period elapses, and increase the length of the idle timeout period as needed.
So you have to device a mechanism to keep the connection busy until the upload completes in 2.5mins.
Hello SIva ,
Thanks for the response. Our app is deployed in US-WEST region and i believe that our gateway is through AWS. So is there a way to only increase the idle-timeout only for our specific app through cf commands or anything ?
Unfortunately it cannot be done per app. Its a global timeout setting. There is no way to control the ELB idle timeout settings from your app.
Also, i believe only the Predix Admin has access to alter these right ?
I would appreciate, if you can suggest some other alternative to this through cf or through app.
PS : this is a Springboot microservice app deployed in Predix
Yes, you are correct. I have asked a few experts to bounce some ideas. You should get some updates on this post if they have any ideas.
Hahah, I was almost going to suggest a web socket solution, until I saw your last line. :)
But in general, most web applications should not have any requests that take so long to return. It's a bad experience for users, and many systems in the stack will probably time out. (browser, web server, microservice, load balancer, etc.)
Without using a websocket, I'd suggest trying to break down your 2.5 minute process into smaller functions. Maybe one step would be just "upload". Then respond to the client with a message, and some kind of process ID. Maybe parsing the xls file is another step. Maybe storing in postgres is another step. At each step, you can communicate to the user what's happening. This could be done in various ways, either a message queue (pub/sub) pattern, or simply have your browser make another HTTP request every 5 or 10 seconds to check the status of the upload process. Hope this helps.
Hello Greg, yes i was thinking of this. But the funny part is this requirement would be for a specific admin. Moreover, they want the admin to wait.. haha :)
Thanks for suggesting anyways :)
Moreover, all this limitation came in after we uploaded to Predix as it was working fine in local. Later on noticed this .
We have some limited time to develop so trying some basic alternatives.