开发者

Google App Engine, Java, and HTTP Performance

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 secon开发者_如何学JAVAds 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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜