OferR
OferR

Reputation: 1644

AppEngine response time is slow

I am using a modified version of the TaskCloud example to try and read/write my own data.

While testing on a a deployed version, I've noticed that the round-trip response time is slow.

From my Android device, I have a 100ms ping response to appspot.com. I have changed the AppEngine application to do nothing (The Google Dashboard shows insignificant Average Latency.

The problem is that the time it takes for HttpClient client .execute(post) is about 3 seconds. (This is the time when an instance is already loaded)

Any suggestions would be greatly appreciated.

EDIT: I've watched the video of Google I/O showing the CloudTasks Android-AppEngine app, and you can see that refreshing the list (a single call to AppEngine) takes about 3 seconds as well. The guy is saying something about performance which I didn't fully get (debuggers are running at both ends?)

The video: http://www.youtube.com/watch?v=M7SxNNC429U&feature=related Time location: 0:46:45

I'll keep investigating... Thanks for your help so far.

EDIT 2: Back to this issue...

I've used shark packet sniffer to find out what is happening. Some of the time is spent negotiating a SSL connection for each server call. Using http (and ACSID) is faster than https (and SACSID).

new DefaultHttpClient() and new HttpPost() are used for each server call.

EDIT 3:

Looking at the sniffer logs again, there is an almost 2 seconds delay before the actual POST.

I have also found out that the issue exists with Android 2.2 (all versions) but is resolved with Android 2.3

EDIT 4: It's been resolved. Please see my answer below.

Upvotes: 1

Views: 5082

Answers (3)

OferR
OferR

Reputation: 1644

After using the Shark sniffer, I was able to understand the exact issue and I've found the answer in this question.

I have used Liudvikas Bukys's comment and solved the problem using the suggested line:

post.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false);

Upvotes: 1

shuaiyuancn
shuaiyuancn

Reputation: 2794

It's difficult to answer your question since no detail about your app is provided. Anyway you can try to use appstats tool provided by Google to analyze the bottleneck.

Upvotes: 1

Stefan
Stefan

Reputation: 744

Often the first call to your GAE app will take longer than subsequent calls. You should make yourself familiar with loading and warm-up requests and how GAE handles instances of your app: http://code.google.com/intl/de-DE/appengine/docs/adminconsole/instances.html

Some things you could also try:

Upvotes: 0

Related Questions