Google App Engine Channel API quota - google-app-engine

I know that there are similar questions, but they aren't up to date anymore. I'd like to know how much it costs to create 1 / 10 / 100 / 1000 channels per day? I only find the pricing list, which doesn't mention channels, and the quota list, which only says "depends on your budget".
I run out of quota really fast. If users access your website only for a short time, then creating 100 channels isn't enough (all other quotas are still 0%). I also read, that reusing channels isn't possible.
Channels are available for two hours. After that they are released. Does the quota mean: "You are only allowed to create 100 channel per day" or does it mean: "You are only allowed to have 100 channels at the same time"?
There is also an API do define when a channel should be released. Does this API even make sense? Let's say I choose to release the channel after one minutes. So while using browsing my website for 5 minutes, the user would create 5 different channels. Does it make sense to decrease the release time?
Thanks!

It costs 10,000 micropennies to create a channel (or 100 channels per 1 cent, see appstats for more)
You shouldn't create more than 1 channel per user.
The free quota says you are only allowed to create 100 channels per day. Enable billing to get more.
I wasn't aware about a possibility of releasing channels and not really sure what is the purpose of doing that and since they are so expensive to create anyway - it's probably better to reuse for the same user in case they return.

Related

GAE Channel API - Channels Created Cost

I have a paid app and can see the quota is 90,040 per day for channels created.
I have looked at all the pricing pages from cloud services and developer pricing pages and can not see any prices regarding the cost per channel created after the 100 free limit.
https://cloud.google.com/appengine/docs/quotas#Channel this page only says the daily limit is "Based on your budget" but I do not see any costs anywhere on the web.
Am I to assume that I get 90,040 free per day for having a paid app
As I understand the pricing changed recently and that's why the documentation is a little confusing. It used to be that you paid a tiny amount for each channel (something like 0.0001 - don't remember how many zeroes).
Now this tiny charge is canceled. You are just paying for CPU & bandwidth that your channels are using. That's why it says according to budget.
It's the same story with Email, and various other APIs as mentioned here: https://cloud.google.com/appengine/pricing. I'm fairly sure Channel API should be included in the last row in the resource billing table.
It costs 10,000 micropennies to create a channel (or 100 channels per 1 cent, see appstats for more).
See a more detailed answer to the same question here: https://groups.google.com/forum/#!topic/google-appengine/uQFWM6F--hY

How strict is the Gmail API's per user per second quota?

Google's documentation states that there is a 25 quota unit rate limit per user per second:
https://developers.google.com/gmail/api/v1/reference/quota
My use case for the Gmail API requires downloading a user's entire mailbox and it appears that use case may not be feasible given these quotas. Downloading 10,000 messages would take roughly 33 minutes.
However, that link also states that the limit is a moving average and suggests that it can be exceeded in small bursts. Can that limit be exceeded significantly enough to meet my use case?
You can raise the per-user limit to 50 units/user/second for your project in the developers console. The limit is only applied over a longer moving window, so you can definitely exceed it for a little bit (O(seconds)). If you need more for longer period, you can request more quota.
While not a full answer, here is my experience on migrating from Gmail to Google Apps for work. My 120000+ conversations/ 200000+ messages mailbox ran close to the 15 GB limit, so I decided to professionalize my account.
After almost 2 days I am now at 22 percent of that migration both in terms of numbers as well as Gigabytes. That is about 60 megabytes/hour and 1000 messages/hour.
Fortunately this runs in reverse chronological order.

any number on Google App Engine free quota in terms of total number of request and unique visitors

Does anyone have any number on Google App Engine (free quota) in terms of total number of request and unique visitors it allows per day?
Maybe someone who has live production code can tell us this?
Rough number is enough, just to get the idea.
I can not get this information from the pricing model.
Thanks
I had this question when I first started using App Engine, but it's impossible to answer with the information in your question.
You must have an estimate on the individual API quota usages, then calculate based on that.
You might be able to simplify it by trying to figure out which API quota you're likely to hit first, and then figuring out the number of requests you can serve before that quota runs out. ie:
Storing photos or other large data for users? You'll probably hit the blobstore quota first. Daily/unique visitor counts probably won't matter.
Serving lots of photos or large data? You'll probably hit the bandwidth quota first.
Need to start a channel for every view? You'll probably hit the channel quota first and get 100 views per day.
Need to send an email for every view? You'll probably hit the mail quota first.
Need to query the datastore a lot? You'll probably hit the datastore limit first.
The datastore limit is the hardest to calculate. You get 50k read and 50k write ops. Most likely you'd read more than write.
If you need 2 read ops per page, you might could do 25k views per day.
If you need 2 read ops per page, but you're smart and you memcache them, and memcache is effective 80% of the time, you could get 125k views per day.
If you need 500 read ops per page and you can't cache it, you can do 100 views per day. That's provided you don't run out of one of the other quotas.
Do your own math.
The quotas and rates (for free and paid apps) are listed on https://developers.google.com/appengine/docs/quotas.

how is Billing for Channel API done?

I've chosen google-app-engine because of its scalability, and now I try to understand how much I will have to pay once I release the product.
I've looked back and forth in the google app engine documentation to find an answer for question and couldn't find. I found few details in the "Quotas" page, I found how much I can get for free and how much is the Billing Default Quota.
In Billing Page there are number for CPU, etc with Resource and Unit and how much it cost. But no where could I find how much will it cost me per channel calls/created, etc.
I can't even try to make calculations with what's in the Admin console, because the current numbers there now are 0 (since there are 2 users which are the programmers).
How can I be ready for the releasing of the product that (hopefully) will have a huge number of channels created daily?
Is there a page I missed, or is there a tool for calculating?
Thanks!
EDIT:
Moishe, thanks for the quick and readable answer. So here are some more questions:
1. Do you think - if needed - that I will be able to get even more quota for the number of channels? I saw there's a special form to ask for more quotas, but I'm not sure that includes the Channel-API feature...
2. Are there any posts you've made for "how to use channel-API efficiently"? I saw some stuff about reusing the tokens per user. Is there more?
Thanks again.
Creating a channel costs about 2.7 CPU-seconds. A CPU-hour costs $0.10. So, each channel created costs
(2.7 / 3 600) * $0.10 = $7.5 × 10^-5
So creating 1000 channels will cost $0.075, or 7.5 cents.
You'll also get charged the normal outgoing bandwidth costs for any data sent over a channel.
The CPU cost probably isn't the biggest concern; you're more likely to run into quota caps then running out of money. Paid apps are limited to 86400 channel creations/day (1/second).

Queuing Emails on App Engine

I need to send out emails at a rate exceeding App Engine's free email quota (8 emails/minute). I'm planning to use a TaskQueue to queue the emails, but I wondered: is there already a library or Python module I could use to automate this? It seems like the kind of problem someone might have run into before.
If it's an option, why not just enable billing? It'll jump the max rate from 8 recipients/minute to 5,100 recipients/minute.
The first 2000 recipients is free each day, as long as you aren't going over the daily free quotas my understanding is that it will not cost you anything (and if you need to email more than 2000 people per day you're going to have to enable billing anyways).
The deferred library is designed for exactly this sort of thing. Simply use deferred.defer(message.send), and make sure the queue you're using has the appropriate execution rate.
its cheaper to just pay for it for a year than to engineer a workaround.
Easiest way in my opinion would be to use a queue, ex Amazon SQS, and pull 8 records per minute, in a cron job running every minute.
Considering it was pushed into the queue, then taken out, I am working out the math that it is an extremely cheap service.
See below, 0.000002 is the rate for 2 requests. (Add and View)
8 requests per minute, 60 minutes in an hour, and 24 hours in a day. Take into account 30 days in the average month, you are still under $1.
0.000002 * 8 * 60 * 24 * 30 = $0.6912
This might not be exactly what you were looking for, but it should be a pretty simple solution.
EDIT:
See here, a python SQS & S3 Lib (sqs is all that you should be looking for).
http://pypi.python.org/pypi/Python-Amazon/0.5
I'm not familiar with any canned solutions to this problem, but it should be something very easy to solve. Write the emails to a datastore table, with an auto_add_now date field to record the order in which they entered. Your cron job that runs every minute pulls the eight oldest records off, mails them and deletes them.
Certainly, if you can solve this is a reasonably generic manner, you can be the person who solves this problem for everyone with a nice open source module.

Resources