AWS Elasticache - Increases memcached item size limit
Im using module memcached
on AWS Elasticache
in my Flask python app (c Flask-Cache
)
When I try to install a file which is smaller 1MB
, I need to access the cache multiple times, I have no problem. But when the file size grows more than MB (the file can be a text file / csv / xlsx etc.), I get the following error
Error: Error 37 from memcached_set: SUCCESS
I assume this is due to the memcached item size limitation, which is limited to 1MB. How do I increase this limit to say 5-6 MB in AWS Elasticache?
Are there any problems increasing this element size limit in memcached?
source to share
This page lists the parameters we can work with in memcached http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheParameterGroups.Memcached.html
If you do not specify a parameter group for your Memcached cluster, the default parameter group (default.memcached1.4) will be used. You cannot change the values โโof any parameters in the default parameter group; however, you can always create a custom parameter group and assign it to your cluster at any time.
Create a new cache parameter group either from the AWS Console or using the AWS CLI and set max_item_size to a size that suits your needs. Reload the cache cluster for this change to kickin.
On your local test machine, if you have memcache installed, you can increase the object size by adding this line to /etc/memcached.conf
# Increase object size limit
-I 128M
Then reload your memcache with sudo service memcached restart
for the changes to be set to
source to share