That is what I expected when I started out...
I now logged a bit more.
Here is what my log says (somewhat abbreviated at [...]):
-----8<----
### doing memcache.GetMulti([ILpYgFifD4a1o8dQFVYkNdNiM9k=
zUKjn+JzC3RdApe4YhbO684/gD8= o3c/FyBzMVHbPrpQsxaJF182DnY= [...]
ospEqFtMA9ZjbfFYJjg7dKbLr68...(length 8962)
----8<----
When I added a log output like:
----8<----
c.Infof("### doing memcache.GetMulti(%v)", keys)
itemHash, err := memcache.GetMulti(c, keys)
----8<----
And the appstats page for the first key shows:
----8<----
@236.15738ms memcache.Get real=7.599035ms cost=0
#### (1)
Request: key:"ILpYgFifD4a1o8dQFVYkNdNiM9k="
key:"zUKjn+JzC3RdApe4YhbO684/gD8=" key:"o3c/FyBzMVHbPrpQsxaJF182DnY="
key:"OB8iOmADx8Y9oWWBFIbIi7b08SM=" key:"ypnJR... #### (3)
Response: Item{key:"ILpYgFifD4a1o8dQFVYkNdNiM9k="
value:"p\020\264\001\005ColorD\264\002\035ConfirmationEmailBodyTemplateD\264\003\"ConfirmationEmailBodyTemplat...
Stack:
go/src/pkg/appengine/memcache/memcache.go:134
common/common.go:302 memGetMulti: itemHash, err :=
memcache.GetMulti(c, keys)
#### (2)
common/common.go:352 MemoizeMulti: items, errors := memGetMulti(c,
keyHashes, destPs)
event/event.go:271 preProcess: exists := common.MemoizeMulti(c,
cacheKeys, values, funcs)
event/event.go:761 GetEventsBetween: preProcess(c, preResult)
event/event.go:847 GetAllowedEventsBetween: })
web/events_controller.go:329 getEvents: common.MustEncodeJSON(w,
event.GetAllowedEventsBetween(data.context,
data.user.Id,
data.authorizer, data.domain, start, end, r.Form["locations"],
r.Form["kinds"], r.Form["types"]))
github.com/mjibson/appstats/appstats.go:255
com/mjibson/appstats.Handler.ServeHTTP: h.f(c, rw, r)
github.com/gorilla/mux/mux.go:86
com/gorilla/mux.(*Router).ServeHTTP: handler.ServeHTTP(w, req)
go/src/pkg/net/http/server.go:1416
go/src/pkg/appengine_internal/api_prod.go:249
go/src/pkg/appengine_internal/api_prod.go:198
go/src/pkg/reflect/value.go:474
go/src/pkg/reflect/value.go:345
_.go:316
go/src/pkg/runtime/proc.c:280
----8<----
Note (1) that the header of the appstats op is memcache.Get while the
stacktrace (2) shows memcache.GetMulti and the 'key' (3) attribute of
the request contains multiple values.
So far so good.
But the next operation that happens i my fallback when the GetMulti
fails to find a value for the 18th key in the GetMulti operation. I
now realized that the fallback is the same thing that happens when I
try to find a single value - which first does a memcache.GetMulti
(with a single value) and then looks in the datastore.
This is, then, the reason I get so many memcache.Get operations in the
appstats log.
But then I notice that it is always (at least 4 out of 4 times when I
looked now) the 18th key in the first GetMulti that fails. And all
keys after that.
Is there a max key length or max value length in memcache.GetMulti,
that makes only my first 17 keys possible to fetch? I get no
ErrCacheMiss or anything like that from key #18 and up.
The plot thickens...