views:

173

answers:

2

A friend and I are currently working on a turn-based game with chat with both desktop browser and Android clients, with Google App Engine as the server.

We're using the Java API for GAE and using HTTP for communication with the server. We've implemented simple chat functionality, and we're getting undesirable latencies 1-3 seconds from both the browser and Android clients while just posting simple one-word chat messages.

My friend thought it would be best to use XMPP instead of HTTP, but we want to use a Google Accounts cookie for authentication from the Android client, and according to the GAE documentation, XMPP clients cannot use a Google Accounts cookie and must use the user's password.

Does anyone have any suggestions as to where the latency might be coming from, how to troubleshoot it, and/or what to do about it?

Also, is anyone aware of any opensource implementations of chat (or something similar) on GAE done in Java? Can't seem to find any.

A: 

One way to analyze the situation would be to use Wireshark to look at the network traffic during the delays.

Peter
A: 

You don't say how your chat messages are getting from one JVM to the other. If you're using the datastore, maybe try memcache?

Also, startup time is often an issue; app engine starts and stops JVMs all the time, particularly for a low-traffic app. A way to diagnose this is to reload the page a bunch of times (send more messages) and see if it gets faster after a while. It should be pretty easy to tell the difference in the admin console logs.

Brian Slesinsky