[Python] Endpoints vs ProtoRPC ~200ms overhead

593 views
Skip to first unread message

alex

unread,
Apr 13, 2013, 4:46:44 AM4/13/13
to google-a...@googlegroups.com
I'm not sure it's even possible (to reduce the overhead), and I do understand there's another infrastructure layer that uses ProtoPRC lib, but still comare this:

@endpoints.api(name='test', version='v1')
class EndpointsTest(remote.Service):
  @endpoints.method(VoidMessage, TestMsg)
    def test(req):
      return TestMsg(msg='Hello there')


curl /test/v1/test
{msg:'Hello there'}

- results in at least 200ms


to this:

class ProtoRpcTest(remote.Service):
  @remote.method(VoidMessage, TestMsg)
  def test(req):
    return TestMsg(msg='Hello there')

curl -X POST /prototest.test
{msg:'Hello there'}

- results in about 7-10ms


There seem to be a few additional roundtrips going on when making requests via Endpoints.
Do you guys think it's possible to reduce the latency?

Dan Holevoet

unread,
Apr 15, 2013, 5:19:39 PM4/15/13
to google-a...@googlegroups.com
Hi Alex,

Can you share a bit more information about how you performed your tests? Are those numbers averages? How many times did you call both APIs? Was this repeatable or did you run the test multiple times?

Thanks,
Dan


--
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-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Dan Holevoet
Google Developer Relations

alex

unread,
Apr 15, 2013, 5:49:02 PM4/15/13
to google-a...@googlegroups.com
Hey, Dan. So, I basically took those numbers from logs of one of my
apps (Python 2.7, threadsafe=true, SDK v1.7.7)

I was looking at the logs the other day and noticed all Endpoints API
calls were taking at least 200ms up to 400-500ms (well, I clearly had
some Datastore and other stuff going on for it to be 500ms).

I started experimenting and ended up with those two simple classes,
EndpointsTest vs ProtoRpcTest, and TestMsg with the only msg string
field.

I then started calling their test method using curl (manually from a
terminal) and watch the logs, for maybe 15-20 mins repeatedly with
about 0.3-0.5 rps rate. I did the average in my head. Pretty easy - it
never went lower than 200ms and higher than 270ms for
EndpointsTest.test, and was in between 6ms-12ms for ProtoRpcTest.test.

This was running an app in EU datacenters. I thought I'd try it with
anothe app in US but got the same results.

Maybe I was doing it all wrong. Actually, I'll be happy to hear that.

Please let me know if this makes sense or I'm just comparing apples to oranges.

Dan Holevoet

unread,
Apr 17, 2013, 5:15:49 PM4/17/13
to google-a...@googlegroups.com
Hi Alex,

No, I don't think you're doing it wrong. Your post encouraged me to find out the results of our internal analysis, which came up similar to what you were seeing. The good news is that there are a few different efforts underway to chip away at the latency total. I can't give specifics, but this is something we're working to improve.

I wouldn't expect Endpoints to be as fast as ProtoRPC, but hopefully we can close the gap a bit. I also hope that the extra features provided by Endpoints (currently, or in the future) will make it worth the latency hit.

Thanks,
Dan

alex

unread,
Apr 18, 2013, 2:47:16 AM4/18/13
to google-a...@googlegroups.com
Great news!
Yeah, of course, I wouldn't expect Endpoints to be as fast either but I think it's really worth it.

Thanks!


Reply all
Reply to author
Forward
0 new messages