Optimizing the usage of the free quota

134 views
Skip to first unread message

Brett Coffin

unread,
Feb 13, 2012, 7:48:14 PM2/13/12
to google-a...@googlegroups.com
Hi, i am trying to make the most of my free quota basicly i am developing an Iphone app selling for 1$ and making use of the google app engine backend, the fact that the only source of income is the selling of the app I can not afford to have to pay for the ungoing service for the app... its a very simple service I only store one 'users' table of data so to use all of the api calls (657,000) provided by the free quota I plan on reading the users table and work ( read/write ) with the in-memory usersArray in my application. The thing is, if the app is idle for to long the instance is turn off and all my data is lost... So I would like to know if I use a conjob to ping or call my service regularly to comit my usersArray to bigTable if this would work ? Any feed back on this would be appreciated, I am very much of a noob when it comes to backend stategies Thanks...

Brandon Wirtz

unread,
Feb 13, 2012, 8:03:18 PM2/13/12
to google-a...@googlegroups.com

You are optimizing for the wrong things.

 

Your app is  a$1 are 20 people going to use it or 20 million?

How do you know that it won’t be 20 million? Did you plan for it to suck?

 

Now that we have established that either your app sucks, so it won’t ever go over the free quota. Or you have decide it won’t suck and will, we can talk about what really matters. Overall price beyond free.

 

If you use the in-instance memory if you get enough traffic to have 2 instance, the info won’t be there. That seems like a flaw in your plan.

 

Memcache isn’t guaranteed but with a tiering strategy could save you money over all.

 

I don’t have all your answers right away, but think about what you need, and how your app will grow

 

 

Brandon Wirtz
BlackWaterOps: President / Lead Mercenary

Description: http://www.linkedin.com/img/signature/bg_slate_385x42.jpg

Work: 510-992-6548
Toll Free: 866-400-4536

IM: dra...@gmail.com (Google Talk)
Skype: drakegreene
YouTube: BlackWaterOpsDotCom

BlackWater Ops

Cloud On A String Mastermind Group


 

image003.jpg

Brett Coffin

unread,
Feb 13, 2012, 10:08:27 PM2/13/12
to google-a...@googlegroups.com
I suppose that the prospect of it not sucking and not reaching the 2 million is what I have in mind... more like 1000 if I am lucky ( that would probably fall in the sucking category for you I suppose... ) but you are right, if a new instance is created it is an issue... I have done a stress test of calls every .1 of a second and it did not create new instances, and I think that even with more that a 1000 users if wont create a new instance... ( if the app did not 'suck' in the end and I was to get an exponatial number of users per day I woud update the service )

but in regards to my question about kipping the instance alive with a cronJob is this possible... I would like to use the conJob to keep the instance alive and to commit the in-memory values to bigTable its just that reading and writing from bigTable every time gets me around 200 users ( so thats 170$ in my poket and now I have to pay for the service.... )

Thank you for your post :)

Brandon Wirtz

unread,
Feb 13, 2012, 10:18:53 PM2/13/12
to google-a...@googlegroups.com

Instances Die when they reach memory limit, when they get bored, when they reach an age limit, when GAE has network issues and changes routing.

 

There is no way to force always serve to the same instance, so when the scheduler decides you need 180 instances and you only need 1 (and only billed for one) you can suddenly have a 1 in 1/180 chance of getting a new instance.

 

Jeff Schnitzer

unread,
Feb 13, 2012, 10:42:10 PM2/13/12
to google-a...@googlegroups.com
This is very premature optimization.  If you're talking about a few thousand users, they'd have to be really busy before it costs you real coin.  Unless you're doing something exotic like running interactive games which constantly write to the server, you should stop worrying about this.

Jeff


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/o_dXNqLF1Y4J.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Brett Coffin

unread,
Feb 13, 2012, 10:43:31 PM2/13/12
to google-a...@googlegroups.com
I did not understand every thing, I was under the impression that 1 instance is created for my app and my app only... and if the number of request received to my instance exceed its capability to answer the request, that a new instance in created... ( am I missing someting on that ? )

Instances Die when they reach memory limit. What kind of memory usage are we talking about here do you have a link ?

when they get bored OK hense the idea of a cronJob to ping it...

when they reach an age limit. So an instance in use could be terminated and a new one started at random times ? Is this documented ?

network issues and changes routing OK

so when the scheduler decides you need 180 instances and you only need 1 What do you mean by this scheduler deciding to create 180 instances of my app ?

I know what I am talking about is a bit of a hack but can this work ? I had a look at memcache but for some reasons I don't think it can serve me...

Thanks






Brett Coffin

unread,
Feb 13, 2012, 10:53:37 PM2/13/12
to google-a...@googlegroups.com
Doing the metrix i got with every read/write operation to BigTable to 10 000 api calls in 24h before the quota was excided. thats 50 calls per 24h for 200 users... Its a geo/social app so 30 to 50 call per user per day would be the average...

Thanks

Brandon Wirtz

unread,
Feb 13, 2012, 10:59:55 PM2/13/12
to google-a...@googlegroups.com

>Instances Die when they reach memory limit. What kind of memory usage are we talking about here do you have a link

You are on F1 Instances if you are running on a free app so 128m



>when they get bored OK hense the idea of a cronJob to ping it...

What if you have a user, and you ping and cause a second instance to Spin up? You might run out of free quota.


>when they reach an age limit. So an instance in use could be terminated and a new one started at random times ? Is this documented ?

Nope, but if you check a big apps instances you won’t find many that are as old as the last code update.


>so when the scheduler decides you need 180 instances and you only need 1 What do you mean by this scheduler deciding to create 180 instances of my app ?

The task scheduler that scales up and down your app sometimes goes wonky, you only pay for in use instances but I often have 40+ instances when I’m only using 4.


>I know what I am talking about is a bit of a hack but can this work ? I had a look at memcache but for some reasons I don't think it can serve me...

Memcache does almost exactly what you were asking about. But It also mysteriously resets at any given moment with out warning.  You can go “Write to memcache” and have the next line be “read from memcache” and your entity could be gone. Not often, but it can happen.

But 500 instances all share memcache so if you say Value=X they will all know it to be true instantly.




Brandon Wirtz

unread,
Feb 13, 2012, 11:03:09 PM2/13/12
to google-a...@googlegroups.com

>10 000 api calls in 24h before the quota was

 

Look at the costs per million write/reads. The number of calls a single user will make per day. Life of the user. Are you cash positive? Or Cash negative?

 

You can fix a lot of things, but if that number is the wrong direction you will lose money over time.

image001.jpg

Jeff Schnitzer

unread,
Feb 13, 2012, 11:13:42 PM2/13/12
to google-a...@googlegroups.com
On Mon, Feb 13, 2012 at 10:53 PM, Brett Coffin <sep...@gmail.com> wrote:
Doing the metrix i got with every read/write operation to BigTable to 10 000 api calls in 24h before the quota was excided. thats 50 calls per 24h for 200 users... Its a geo/social app so 30 to 50 call per user per day would be the average...

...and when you hit the free datastore limit, you enable billing for $9/mo.  Less than the cost of a cheap VPS, which is your other option.  And suddenly you can do 9 million operations per month, which should support at least 6,000 users by that metric.

Jeff

Brett Coffin

unread,
Feb 13, 2012, 11:29:56 PM2/13/12
to google-a...@googlegroups.com
Thanks for that, its giving me a bit of hope :) I was starting to get depress lol I think I realized that the in-memory idea will not work because on top of every thing else ( tell me if i am wrong ) new instances of the application could be created if users where located on differente continents is that correct ?

Brett Coffin

unread,
Feb 13, 2012, 11:42:47 PM2/13/12
to google-a...@googlegroups.com
Well when you think of an app providing a service and the only source of income being the selling of the app and runing the service cost money, in the end you will lose money so what do you do ?

Brandon Wirtz

unread,
Feb 13, 2012, 11:49:20 PM2/13/12
to google-a...@googlegroups.com

Ads.

Sell the users information.

Get to critical mass, pocket the money, go out of business before the money runs out.

 

Jeff Schnitzer

unread,
Feb 14, 2012, 1:03:04 AM2/14/12
to google-a...@googlegroups.com
On Mon, Feb 13, 2012 at 11:42 PM, Brett Coffin <sep...@gmail.com> wrote:
Well when you think of an app providing a service and the only source of income being the selling of the app and runing the service cost money, in the end you will lose money so what do you do ?

I can tell you what I do for my failures:  Just pay the $9/mo.  Think of it as a living resume that costs about $100 per year.  I get at least $9/mo of satisfaction out of being able to point at a website and say "I did that", even if the community isn't self-sustaining.

Jeff

Brandon Wirtz

unread,
Feb 14, 2012, 1:27:42 AM2/14/12
to google-a...@googlegroups.com

>.  I get at least $9/mo of satisfaction out of being able to point at a website and say "I did that", even if the community isn't self-sustaining.

 

I like you Jeff. You remind me of me only NICER. (and with better code)

Robert Kluin

unread,
Feb 14, 2012, 2:53:10 AM2/14/12
to google-a...@googlegroups.com

The last option is probably the best bet.


Seriously though, you're developing an app that needs a backend
service, you sell for $1, and you only hope to get 1000 users? On one
hand I respect the realistic goal/view, but the *first* thing I'd do
is aim a little higher. (not meant as an insult)

>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.

Thomas Wiradikusuma

unread,
Feb 14, 2012, 10:52:15 PM2/14/12
to Google App Engine
Hi Brett,

If you know your user base won't require more than 1 instance of
server (so you can put everything in local memory and not be concerned
with clustering), why don't you get a cheap VPS? http://prgmr.com/xen/
is pretty good for the price.

Unlike GAE which can spawn more instances when required, in VPS by
default you only have one. (of course, take your own risk if it's
overloaded)

Brett Coffin

unread,
Feb 15, 2012, 12:30:16 AM2/15/12
to google-a...@googlegroups.com
Hi Thomas,

This is my first time, so I am discovering/understanding things as I go...  I have already written all the service in Java with Objectify and all I want now is to get it out :)
I suppose I ll decide on what's the best option when i get some traffic ( if i get any... )

Thanks for the tip...

Brett Coffin

unread,
Feb 15, 2012, 12:36:55 AM2/15/12
to google-a...@googlegroups.com
You are right, ( and I was thinking about this when I wrote that post ), if I get 1000 users that would probably mean I am reaching a tipping point, then why would it stop there.... as I am a big noob in all this, I need to try and learn :)
Reply all
Reply to author
Forward
0 new messages