I'm storing an object of size 7-10MB in Memcached and just after putting the object, trying to retrieve it. I get cache misses in that case. Any idea why? This solution works for smaller object sizes.
Background Info:
I'm using Memcached to store a set of large objects of approximately 7-10 MB size. For some reason, it's not possible for me to split this object into multiple smaller keys. I want the cache to be redundant and warm, and hence, I use a slightly complicated cache put procedure, as described below:
keySet = makeRedundantKeys(key) // Appends a unique num to the key
putAsync(keys in keyset)
while(!timeout || countNonNullKeys > desiredQuorumOfKeys) {
countNonNullKeys = getSyncKeys(key in keySet)
sleep(backoffTime);
}
I'm getting a lot of failures where getSyncKeys is taking about 700ms to get just one key. Any idea why this might happen? This is observed only for the large objects. Smaller objects <1MB work fine and return the data in ~2ms pAvg. These are good m4.2xlarge EC2 hosts with high network performance. Also, my TCP Retransmitted segment graph spikes up to 1500/min, which seems fishy.
By default, memcached will only store objects up to 1MB by default:
you can use the -I option to increase this.
In your case you'd need to set
-Ito be10m. You're using AWS, so if you're running your own memcached server, you'll be able to do this yourself, but if you're using AWS Elasticache, you'll need to create a parameter group, change themax_item_sizefrom 1MB (1048576) to 10MB (10485760) and apply it to the Elasticache cluster, which needs a reboot.