curl - Java Standard Appengine Latency analysis

142 views
Skip to first unread message

Rajesh Gupta

unread,
May 23, 2017, 3:07:16 AM5/23/17
to google-a...@googlegroups.com
Hello Team,

Java Appengine zone: asia-southeast1-a

I have Java standard appengine app running  with a simple endpoints api.

Also, I have compute engine instance ubuntu created in the same time zone: asia-southeast1-a.  By doing this, I was expecting that curl client should get a very quick response with out much latency, as the curl client and server are both running in the same Google data center in the same zone.

I run the curl for testing the endpoints api.  Many times, I get a very huge latency. 

Curl timings: Why the 'time_starttransfer' is so high and varying.  

rajesh_gupta@instance-3:~$ curl -w "@curl-format.txt" -o NUL -s --data "emailId=vsxyz123@veersoftsolutions.com&password=123456&count=2" https://field-works1.appspot.com/_ah/api/vsloginendpoint/v2/vsLoginIonic2time_namelookup: 0.004 time_connect: 0.009 time_appconnect: 0.110 time_pretransfer: 0.110 time_redirect: 0.000 time_starttransfer: 1.059 ---------- time_total: 1.060rajesh_gupta@instance-3:~$ curl -w "@curl-format.txt" -o NUL -s --data "emailId=vsxyz123@veersoftsolutions.com&password=123456&count=2" https://field-works1.appspot.com/_ah/api/vsloginendpoint/v2/vsLoginIonic2time_namelookup: 0.004 time_connect: 0.005 time_appconnect: 0.109 time_pretransfer: 0.109 time_redirect: 0.000 time_starttransfer: 14.565 ---------- time_total: 14.565rajesh_gupta@instance-3:~$ curl -w "@curl-format.txt" -o NUL -s --data "emailId=vsxyz123@veersoftsolutions.com&password=123456&count=2" https://field-works1.appspot.com/_ah/api/vsloginendpoint/v2/vsLoginIonic2time_namelookup: 0.004 time_connect: 0.005 time_appconnect: 0.102 time_pretransfer: 0.102 time_redirect: 0.000 time_starttransfer: 4.132 ---------- time_total: 4.132rajesh_gupta@instance-3:~$ curl -w "@curl-format.txt" -o NUL -s --data "emailId=vsxyz123@veersoftsolutions.com&password=123456&count=2" https://field-works1.appspot.com/_ah/api/vsloginendpoint/v2/vsLoginIonic2time_namelookup: 0.004 time_connect: 0.005 time_appconnect: 0.106 time_pretransfer: 0.106 time_redirect: 0.000 time_starttransfer: 3.930 ---------- time_total: 3.930

Sample Appengine Logs: 

Inline image 1

Regards,
Rajesh
Accounting/Inventory/Orders/Sales/Purchase on Google Cloud Platform and Mobile

Nicholas (Google Cloud Support)

unread,
May 23, 2017, 10:57:39 AM5/23/17
to Google App Engine
Hey Rajesh,

There are many contributors to latency depending on the variables that we observe.  time_starttransfer for instance, is defined as:
The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result.

It thus includes all the time up until the when your endpoint service sends its response.  Assuming your curl time_starttransfer examples correlate to the endpoint log entries, it would seem the majority of the time is spent sending and routing the request in this case from the GCE instance to the endpoint handler.  While there may be many steps and intermediate devices between the each instance, several seconds is generally a somewhat high latency.

There aren't any issues presently with Compute Engine networking or Endpoints.  If you believe this to be an issue with the platform, I would recommend filing a public issue on Issue Tracker as this forum is generally reserved for sharing best practices and design concepts.  When reporting an issue, be sure to include a minimal reproduction that can reliably demonstrate the latency you describe along with a time frame for when you've been able to reproduce these results.

Rajesh Gupta

unread,
May 24, 2017, 7:55:49 AM5/24/17
to google-a...@googlegroups.com
We have experimented with the helloworld endpoints example.  The results are consistently the same as given earlier

A issue is filed on the issue tracker.  Please note the no.

Anyone facing the latency issues with the endpoints framework?  

Regards,
Rajesh
Accounting/Inventory/Orders/Sales/Purchase on Google Cloud Platform and Mobile


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/f12db071-363a-4f5a-96f5-d91f08246ac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Esteban Bonham

unread,
Nov 27, 2017, 12:49:13 AM11/27/17
to Google App Engine
I am seeing this exact same problem. I did not have permission to look at the issue you wrote. Has there been any movement on this? I was seeing unexplained latency in my app so I reverted back to the echo example (python standard). I also wrote this stack overflow post: 


Having up to 1.3 seconds of unexplained latency makes my app feels sluggish and seems unreasonable when I have optimized all my datastore and other interactions that are within my control.

Here are some examples with one instance active:

MacBook-Pro$ curl -H "Content-Type: application/json" -X POST -d '{"content":"hello world"}' https://testtictactoe-164905.appspot.com/_ah/api/echo/v1/echo -w "@curl-format.txt"

{

 "content": "hello world"

}

time_namelookup: 0.005

time_connect: 0.019

time_appconnect: 0.143

time_pretransfer: 0.144

time_redirect: 0.000

time_starttransfer: 0.660

--------

time_total: 0.660


MacBook-Pro$ curl -H "Content-Type: application/json" -X POST -d '{"content":"hello world"}' https://testtictactoe-164905.appspot.com/_ah/api/echo/v1/echo -w "@curl-format.txt"

{

 "content": "hello world"

}

time_namelookup: 0.005

time_connect: 0.021

time_appconnect: 0.145

time_pretransfer: 0.145

time_redirect: 0.000

time_starttransfer: 1.028

--------

time_total: 1.028



MacBook-Pro$ curl -H "Content-Type: application/json" -X POST -d '{"content":"hello world"}' https://testtictactoe-164905.appspot.com/_ah/api/echo/v1/echo -w "@curl-format.txt"

{

 "content": "hello world"

}

time_namelookup: 0.528

time_connect: 0.542

time_appconnect: 0.668

time_pretransfer: 0.668

time_redirect: 0.000

time_starttransfer: 0.912

--------

time_total: 0.912


MacBook-Pro$ curl -H "Content-Type: application/json" -X POST -d '{"content":"hello world"}' https://testtictactoe-164905.appspot.com/_ah/api/echo/v1/echo -w "@curl-format.txt"

{

 "content": "hello world"

}

time_namelookup: 0.005

time_connect: 0.019

time_appconnect: 0.141

time_pretransfer: 0.141

time_redirect: 0.000

time_starttransfer: 0.903

--------

time_total: 0.903


MacBook-Pro$ curl -H "Content-Type: application/json" -X POST -d '{"content":"hello world"}' https://testtictactoe-164905.appspot.com/_ah/api/echo/v1/echo -w "@curl-format.txt"

{

 "content": "hello world"

}

time_namelookup: 0.005

time_connect: 0.018

time_appconnect: 0.151

time_pretransfer: 0.151

time_redirect: 0.000

time_starttransfer: 1.597

--------

time_total: 1.597

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages