Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shared memcache vs. dedicated memcache & quota calculation

I have an app that stores ~20000 entries in the memcache. Each entry is a Serializable with one String and two integers. I set the expiration time to 6 hours.

So I was using the shared/free memcache. It only seemed to store ~5000 entries -> ~7mb. The oldest entry is always just some minutes old. Why is that?

Then I thought: let's switch to dedicated memcache. Then the cache runs fine, it stores all entries, oldest entry is 6 hours old, everything is as expected. Except for the quota. After just some hours it says that I already used 18 "Gbyte hours".

Well my total cache size is ~11mb. So I would guess that the cost would be ($0.12 / Gbyte / hr) -> $0.12*~0.01Gb*24hrs per day, which would be just ~$0.03.

What am I doing wrong? Is my calculation wrong? Do I misunderstand the meaning of "Gbyte hours"?

like image 965
Goddchen Avatar asked Dec 06 '13 20:12

Goddchen


2 Answers

AppEngine dedicated memcache is priced per 1GB chunks, not based on what you use in your dedicated allocated 1GB of storage. See here https://developers.google.com/appengine/docs/adminconsole/memcache

Your dedicated memcache will cost you a flat $2.88 per day.

The "dedicated" gives you space but operations per seconds (10,000 ops per second).

Regarding your experience on the shared (and free) memcache, what you are seeing here is not what you should generally expect. You are unfortunately most likely on an AppEngine cluster where some other apps are abusing the shared memcache.

like image 134
Jerome Avatar answered Oct 13 '22 11:10

Jerome


The dedicated memcache bills by the gigabyte. So anything less than 1GB is billed as 1GB, and you probably had it running for 18hrs. Yeah, kinda sucks.

like image 4
dragonx Avatar answered Oct 13 '22 09:10

dragonx