~200 ms or >200 ms lags

11 views
Skip to first unread message

Broadsmile

unread,
Jul 11, 2010, 9:01:01 AM7/11/10
to Google App Engine
Hi! I'm new to the GAE Engine, I found it will be a nice engine for my
mmorpg game. For now I'm still investigating what Can I do with this
technology, and what I can't. I want my game to be real-time based and
am now testing the server to see how responsive it can be.

One of first things I did was pinging the app-name.appspot.com to see
the lags. It was, and still is ~50ms.
However! Pinging may be faster then actually sending and receiving
data. So I made a simple benchmark in flash + python:
http://lagstest.appspot.com/gra

I get about 200 ms lag, and it's too bad for some really fast action
in realtime (althought I even don't really want so fast action so I
don't need small lag). Sometimes lag is spiking to even a second and
that's alarming. Also something weird happened - I get ~50 ms lag on
offline devserver - that means, that flash, server or pyAMF is a
significant factor! :O

I made the source code public http://lagstest.appspot.com/lagtest.zip
(99% of the source code is by Aral Balkan - MIT licence - anyway).

I live in Poland.

So I have several questions:
1. Should I expect smaller lag? How to achieve that with flash + GAE?
2. Should I repost on Python GAE?
3. Any tips for a begginer ?
4. Any opensource projects to see, that have a good connection?
5. Is my place of living a factor? What do You see on this benchmark?
6. What's the sense of life?
7. Is my code allright or Aral Balkans code is already outdated? (I
didn't upgrade AMF to the up-to-date version yet)

Thank You in Advance.

Nick Joyce

unread,
Jul 12, 2010, 10:53:35 PM7/12/10
to Google App Engine
On Jul 11, 11:01 pm, Broadsmile <broadysm...@gmail.com> wrote:
> Hi! I'm new to the GAE Engine, I found it will be a nice engine for my
> mmorpg game. For now I'm still investigating what Can I do with this
> technology, and what I can't. I want my game to be real-time based and
> am now testing the server to see how responsive it can be.
>
> One of first things I did was pinging the app-name.appspot.com to see
> the lags. It was, and still is ~50ms.
> However! Pinging may be faster then actually sending and receiving
> data. So I made a simple benchmark in flash + python:http://lagstest.appspot.com/gra
>
> I get about 200 ms lag, and it's too bad for some really fast action
> in realtime (althought I even don't really want so fast action so I
> don't need small lag). Sometimes lag is spiking to even a second and
> that's alarming. Also something weird happened - I get ~50 ms lag on
> offline devserver - that means, that flash, server or pyAMF is a
> significant factor! :O
>
> I made the source code publichttp://lagstest.appspot.com/lagtest.zip
> (99% of the source code is by Aral Balkan - MIT licence - anyway).
>
> I live in Poland.
>
> So I have several questions:
> 1. Should I expect smaller lag? How to achieve that with flash + GAE?
> 2. Should I repost on Python GAE?
> 3. Any tips for a begginer ?
> 4. Any opensource projects to see, that have a good connection?
> 5. Is my place of living a factor? What do You see on this benchmark?
> 6. What's the sense of life?
> 7. Is my code allright or Aral Balkans code is already outdated? (I
> didn't upgrade AMF to the up-to-date version yet)
>
> Thank You in Advance.

I took a look at the zip and noticed that you are using PyAMF 0.3.0b,
which is ancient! :)

A lot of work has gone into optimising the PyAMF (x4-x8 improvement of
d/encoding times is not unusual) as well as much improved integration
with the Datastore.

0.6 is about to be released and if you are looking for speed then you
probably want that version [1] (rather than the relatively old 0.5.1).
It should be largely backwards compatible with your current code.

Cheers,

Nick

[1] - http://github.com/hydralabs/pyamf

Nick Joyce

unread,
Jul 13, 2010, 2:52:46 AM7/13/10
to Google App Engine
On Jul 11, 11:01 pm, Broadsmile <broadysm...@gmail.com> wrote:
> Hi! I'm new to the GAE Engine, I found it will be a nice engine for my
> mmorpg game. For now I'm still investigating what Can I do with this
> technology, and what I can't. I want my game to be real-time based and
> am now testing the server to see how responsive it can be.
>
> One of first things I did was pinging the app-name.appspot.com to see
> the lags. It was, and still is ~50ms.
> However! Pinging may be faster then actually sending and receiving
> data. So I made a simple benchmark in flash + python:http://lagstest.appspot.com/gra
>
> I get about 200 ms lag, and it's too bad for some really fast action
> in realtime (althought I even don't really want so fast action so I
> don't need small lag). Sometimes lag is spiking to even a second and
> that's alarming. Also something weird happened - I get ~50 ms lag on
> offline devserver - that means, that flash, server or pyAMF is a
> significant factor! :O
>
> I made the source code publichttp://lagstest.appspot.com/lagtest.zip
> (99% of the source code is by Aral Balkan - MIT licence - anyway).
>
> I live in Poland.
>
> So I have several questions:
> 1. Should I expect smaller lag? How to achieve that with flash + GAE?
> 2. Should I repost on Python GAE?
> 3. Any tips for a begginer ?
> 4. Any opensource projects to see, that have a good connection?
> 5. Is my place of living a factor? What do You see on this benchmark?
> 6. What's the sense of life?
> 7. Is my code allright or Aral Balkans code is already outdated? (I
> didn't upgrade AMF to the up-to-date version yet)
>
> Thank You in Advance.

I took a brief look at the zip and noticed that you are using PyAMF
0.3.0b, which is ancient! :)

There has been a lot of effort to optimise PyAMF since that version
(x4-x8 speed up in d/encoding is not unusual). If speed is your king
then I would suggest you take a look at the soon to be released 0.6
[1] which is largely backwards compatible with all older versions.

Broadsmile

unread,
Jul 13, 2010, 2:49:12 PM7/13/10
to Google App Engine
Thanks for Your answer! Aral Balkan's example is very old and I'm
aware of that. You suprised me by the technological jump of pyAMF, but
unfortunately upgrading it has no effect in my case (probably because
I don't send/get a lot of data, so pyAMF can't show off it's
serialization/deserialization skills.

OLD: http://0.latest.lagstest.appspot.com/gra
NEW: http://1.latest.lagstest.appspot.com/gra

Probably 50 ms offline lag is a fault of flash. But still, without
these 50 ms lag server will have 150 ms, while it pings with 50. Maybe
there's some multi wrong techniques stacked one on eachother. I will
never know that until I see some better lag tester, that accomplishes
~50 ms (well, any under 150 ms will be nice) online lag.

So I repeat my questions and add more of them:
1. Does anyone have similar GAE lag tester? I don't care about
technology, I care if it shows different pings.
2. Ad 7: does anyone know if there's something more in Aral Balkan's
example that's ancient and wrong nowadays?
3. Does the God exist?
4. Is there any flash group I could ask it as well? (I'm kinda not a
group discussant type and I'm not oriented...)

Thanks for Your try, Nick! And I'm looking forward to next hints!

Nick Joyce

unread,
Jul 14, 2010, 7:38:45 PM7/14/10
to Google App Engine
Sorry for the double post, couldn't see my first answer :)

Appspot likes to consume instances of your application fairly quickly
if you don't get a lot of traffic. Initialising a cold one (for the
first request) can take quite a bit longer than a warm instance, due
to all the code loading you have to do (python imports etc.). You may
be hitting into this.

I would suggest removing your dependancy on Aral's code and build an
app as described in http://pyamf.org/tutorials/gateways/appengine.html.
This will be able to tell you if that code is slowing you down or not.

Hth,

Nick

Broadsmile

unread,
Jul 17, 2010, 1:24:33 PM7/17/10
to Google App Engine
Yes, I know that first (and a few in case of firing them one after
another in short delays like 200 ms like in my benchmark) request is
slow, but I care about the next requests, that take ~50 ms without any
distance between server and client and ~200 ms from appspot.com, 150
ms more then by pinging it. Well, sometimes I get a few requests in
middle with ~600 ms lag - can it be because requesting my app every
200 ms still isn't enough to keep it warm?? I rather suspect that too
big frequency of requests is making a bottleneck on client side.

I deleted all Aral Balkan's stuff and made my own code:
http://2.latest.lagstest.appspot.com
and this time tiny sourcecode:
http://2.latest.lagstest.appspot.com/lagtest.zip
and used URLLoaded instead of AMF - no difference.

I tested it on a cheap PHP server I use and it was better, but when I
test it know to make sure, it's much worse then GAE.
Probably You can't achieve better (smaller) lags with this technology.
But that is an answer I want to get from some guru, so I don't need to
bother doing various benchmarks.

Because lags increase when user makes client CPU busy, I'm pretty sure
the 50 ms local lag is a flash issue. I will repost it on some flash
forum.

Still, I'm VERY suprised that noone before benchmarked GAE's lag...

On 15 Lip, 01:38, Nick Joyce <n...@boxdesign.co.uk> wrote:
> Sorry for the double post, couldn't see my first answer :)
>
> Appspot likes to consume instances of your application fairly quickly
> if you don't get a lot of traffic. Initialising a cold one (for the
> first request) can take quite a bit longer than a warm instance, due
> to all the code loading you have to do (python imports etc.). You may
> be hitting into this.
>
> I would suggest removing your dependancy on Aral's code and build an
> app as described inhttp://pyamf.org/tutorials/gateways/appengine.html.
Reply all
Reply to author
Forward
0 new messages