Memcache Costs

327 views
Skip to first unread message

Richard Cheesmar

unread,
Mar 10, 2017, 12:26:47 PM3/10/17
to Google App Engine
In the docs regarding costs, dedicated Memcache is priced at 0.06 USD per GB an hour. On the price calculator you can specify MB of memcache per hour. So are you charged on a Mb basis per hour if you are using say no more than 50MB per hour?


George (Cloud Platform Support)

unread,
Mar 10, 2017, 3:34:14 PM3/10/17
to Google App Engine
The pricing you quote refers to dedicated Memcache (as shared Memcache is free). This provides a fixed cache capacity assigned exclusively to your application. You need to actually reserve this fixed capacity through the developers’ console. This is accomplished by navigating to App Engine → Memcache → Memcache Service Level top left of the frame. To reserve your dedicated Memcache volume, you click on the “Change” link for service level, then choose the desired volume of dedicated cache that your application requires. 

Pricing is based on the GB per hour of cache size. Solely the amount of cache memory used gets billed, not the read-write traffic. The MB-level granularity is not specified directly in the documentation, you are right about it. Still, when one tries to reserve dedicated cache by navigating to the Memcache page, as described above, one notices that a value less than 1 GB is not allowed, nor decimals above 1 GB.

Richard Cheesmar

unread,
Mar 11, 2017, 1:58:56 AM3/11/17
to Google App Engine
Yes, I specified dedicated memcache in my question.

So the sentence "Solely the amount of cache memory used gets billed"  is a yes to the question? I will only get charged for the Megabytes of memcached used even though I have to select a minimum of 1 Gigabyte.

George (Cloud Platform Support)

unread,
Mar 13, 2017, 9:46:55 AM3/13/17
to Google App Engine
You are right about the minimum of 1GB. The reproduction described in my previous post indicates that one can only choose extra amounts of 1GB of cache memory, as step-by-step increase. Pricing is based on the amount of cache reserved for you, not necessarily the one used momentarily. 

Richard Cheesmar

unread,
Mar 14, 2017, 12:56:09 PM3/14/17
to Google App Engine

George, sorry but I'm still not clear on this. Are you stating that I have to pay for 1GB per hour even if I only require 20MB?

If this is true this seems a tad hard as that 1 GB of dedicated memcache is going to cost in the region of 45 USD per month. When I only require,  at this stage around  20MB of dedicated memcache, if that. Given this I would be paying for something I'm not using which hardly seems justified.

Just to be clear here, that 20MB would be permanent so not in and out of memcache.

Can I have a definitive answer on this please.

Thank you.



On Friday, March 10, 2017 at 8:26:47 PM UTC+3, Richard Cheesmar wrote:

Barry Hunter

unread,
Mar 14, 2017, 1:10:34 PM3/14/17
to google-appengine

 
Are you stating that I have to pay for 1GB per hour even if I only require 20MB?

From experience. Yes. 

> Dedicated memcache provides a fixed cache capacity assigned exclusively to your application. It's billed by the GB-hour of cache size and requires billing to be enabled.

(guess, just an artifact of the 'Calculator' that its in effect letting you enter fractions of a GB.) 


... possibly a reflection of what it costs Google. To offer dedicated memcache, they probably have to 'spin up' a dedicated instance of memcache (so it can enforce the memory limit), on a number of machines. Its just not viable to do that for tiny amounts of memory. 


20Mb, sounds like would work ok on 'free' memcache. If worried about loosing it, have it backed by other means (database) too

Andrei Volgin

unread,
Mar 14, 2017, 6:43:05 PM3/14/17
to Google App Engine
Richard,

Both free and dedicated memcache can disappear at any moment - it happens rarely, but it can happen. The only difference is that with dedicated memcache objects will not be evicted unless you exceed reserved capacity, while with free memcache there is no guaranteed capacity.

20MB is a very small size to worry about. It will be available *almost* always. If *almost* is not good enough for you, then you have to reserve 1GB of memcache. You can always run your app for a few days and see if you get any evictions because of capacity limits. I doubt you will see any.

Also, you may consider keeping all 20MB of data in instance memory, which is even faster than memcache and is always guaranteed. The drawback is that each instance will have to load and keep its own copy of this data, and all copies may quickly become out of sync, which may or may not be a problem given your data architecture and requirements.

Andrei

Richard Cheesmar

unread,
Mar 15, 2017, 10:03:04 AM3/15/17
to Google App Engine
Barry, thanks for reply.

I have it backed up by a mapped ndb model, so it is not critical, but I prefer memcache for speed and minimal reads. As for the calculator, you might be right.

Andrei,

I haven't really looked at instance memory but that sure sounds like a solution, thanks for the heads up.

On Friday, March 10, 2017 at 8:26:47 PM UTC+3, Richard Cheesmar wrote:
Reply all
Reply to author
Forward
0 new messages