Push notifications sender module eats money

71 views
Skip to first unread message

André Solberg

unread,
Aug 30, 2015, 10:07:35 AM8/30/15
to Google App Engine
I have an App Engine project as backend for an iOS app. The default module has dynamic scaling and is mostly idle. I have a separate module with manual scaling and 1 instance always running, which is constantly checking the task queue for notifications to send. After this module was deployed, instance hours exploded and I now have estimated charge of $54 for this month. I basically followed the pattern that was described in this tutorial: https://cloud.google.com/appengine/docs/java/taskqueue/overview-push

This pricing is unacceptable for a low traffic app like ours. Is my only other and cheaper option to just handle the sending of push notifications directly in the request to the default module, instead of enqueueing it in the task queue?

Nick (Cloud Platform Support)

unread,
Aug 31, 2015, 6:47:22 PM8/31/15
to Google App Engine
Hi Andre,

So, there are several issues here, the most important to address to start is the fact that as far as billing goes, you're responsible for anything you deploy on the platform. Having a manual scaling module always up and making requests constantly will definitely tend to increase your use of billable resources.

Now to get to the technical details, from reading the docs it's clear that the push queue documentation doesn't recommend a manual scaling module in this manner at all. The use of push queues is best combined with an automatic scaling module, so that the the tasks which are pushed will trigger requests on that module, and it will spin up or down depending on the volume of tasks to process. I think you're thinking of pull queues if you've implemented something to check if queues are available. 

As for your last question, you don't need to send push queue tasks to the default module. You can set a module target when you create the task, and this is described in the docs page you linked (ctrl + f "target").

Let me know if I've misunderstood anything about your post or if you have any questions beyond this and I'll be happy to help.

Best wishes,

Nick

André Solberg

unread,
Sep 1, 2015, 9:15:49 AM9/1/15
to Google App Engine
Hi, thanks for your reply.

Sorry, I pasted the wrong link, the tutorial I meant was this: https://cloud.google.com/solutions/mobile/ios-push-notifications/

I have done as described in this tutorial using the pull queue "notification-delivery" for sending notifications. So basically what I can do is just make this a push queue instead, set the module to automatic scaling, and then use the target parameter to that module when queueing the notifications, is that right?

Kaan Soral

unread,
Sep 1, 2015, 3:28:04 PM9/1/15
to Google App Engine
I pay $15 daily for no traffic #cloudlyfe

For me the cost is to keep instances primed as otherwise the delay can reach 30 seconds for the user, which causes the app to lose it's very first users, so $15/daily it is (and some periodic tasks)

$54/mo is very acceptable, I would suggest only triggering a task when a push notification is needed (one task, it could poll a bit more to make sure you don't connect to APNS simultaneously etc.)

Kaan Soral

unread,
Sep 1, 2015, 3:32:05 PM9/1/15
to Google App Engine
To add to this story, I have another app that I pay $18/daily that handles users at 100k magnitude

So, mostly, only the base cost is a bit high, once you scale, things become much more acceptable

pdknsk

unread,
Sep 1, 2015, 5:30:56 PM9/1/15
to Google App Engine
Just use managed VMs with f1-micro instances at $4.49 per month.
Reply all
Reply to author
Forward
0 new messages