Christer Nordvik
Christer Nordvik

Reputation: 2528

Optimal queue definition in Google App Engine for push notifications where time to user is most important

We have a GAE application that notifies users of sports goal changes and we want to notify them as fast as possible. Currently we create one entry in a GAE queue for each notification and this works fairly well. but lately it struggles a bit with sending 2000-3000 notifications at one score change.

What is the optimal queue configuration to send these events as fast as possible?

Currently we have:

<queue>
  <name>c2dm</name>
  <rate>10/s</rate>    
</queue>  

and in appengine-web.xml

<threadsafe>true</threadsafe>

Upvotes: 0

Views: 287

Answers (1)

Dan Sanderson
Dan Sanderson

Reputation: 2111

You can increase the rate and bucket size to get the push queue to execute tasks faster. You can also leave max-concurrent-requests unset (unlimited). This will drive tasks up to the maximum number of instances you have configured, times the throughput of a single instance of your app. You can also increase your instance count maximum.

Note that "as fast as possible" might not be the ideal. You'll want to tweak these values based on the burst patterns, instance warm-up costs, datastore contention error rates, etc. until you're getting comfortable performance. If you need even more control, consider using pull queues, either with an App Engine backend instance (or several) or a notifications service running on another platform that calls the pull queues REST API.

Upvotes: 1

Related Questions