CustomCode Latency

0 votes
I have a simple custom code request, but it takes a huge amount of 3000ms in average to return response to client. While looking into the Billing & Metering section of the dashboard I can see the following after each custom code execution:

- CustomCode / runJava / 137ms

- Storage / findDocumentById / 29ms

So it looks like the code on server is executed really fast (166ms) but the signal takes a lot just to reach the server and get back (2800+ms). Why it takes so long? We are based in Moldova and I have tested through wi-fi and fiber optics connection.
asked Nov 18, 2014 in App42 Cloud API-BaaS by vladislav (10 points)

1 Answer

0 votes
Hello Vladislav,
 
Kindly check you internet connection speed, because the return time increasing when your internet connection is slow. The time which is in Billing & metering is same which take on server to execute your request.
 
Let us know if you have more question for us.
 
Thanks,
 
Himanshu Sharma 
answered Nov 19, 2014 by hs00105 (2,005 points)
I have checked from 3 places - from work, from home and I asked a developer to check it from another country - Estonia. And it's the same... where are your App42 Cloud servers located?
We execution time that you are seeing in dashboard in the time difference between your request enters our gateway and it leaves it. Rest of the time that you are getting in executing end to end is the time spent in transition (depends on bandwidth) and then processing and parsing it on your app. To conclude, rest of the time is dependent on bandwidth and the client machine.
our servers are located in US btw.
We figured out why the custom code is slow - basically, every time the custom code is requested to be run on server, a new connection is negotiated between client and server (please see the link with a process monitor inspection of the request) and it looks like it can take 1000-1500 ms.

https://www.dropbox.com/s/1k9xhijcrers9fv/custom_code_connection.jpg?dl=0

It it possible to leave the connection open?
Its not about custom code which take extra time to open or create new connection between server & client SDK,all REST api works in the same fashion. Normally it will take to this much time to open a new connection between server & client and than close it.
Let us know if you have more question for us.
Himanshu Sharma
I hope your query has been resolved. Let us know if you have more question for us.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...