Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elasticache - increase memcached item size limit

Im using the memcached module on AWS Elasticache in my python Flask app (with Flask-Cache)

When i try to set a file that is less than 1MB i need to repeatedly access to the cache, i have no issues. But when the file size increases more than a MB (the file could be a text file/csv/xlsx etc), i get the following error

Error: error 37 from memcached_set: SUCCESS

Im guessing its because of the size limit on a memcached item which is capped at 1MB. How do i increase this item limit to say 5-6 MB in AWS Elasticache ?

Are there any issues in increasing this item size limit in memcached ?

like image 597
Shankar ARUL Avatar asked Jul 21 '15 22:07

Shankar ARUL


People also ask

How many nodes can I run in Amazon ElastiCache Memcached?

For additional details please see ElastiCache VPC documentation. Q: How many nodes can I run per region in Amazon ElastiCache Memcached? You can run a maximum of 300 nodes per region. If you need more nodes, please fill in the ElastiCache Limit Increase Request form. Q: How does Amazon ElastiCache respond to node failure?

What is Amazon ElastiCache FAQ?

Amazon ElastiCache FAQs 1 General. Q: What is Amazon ElastiCache? Amazon ElastiCache is a web service that makes it easy to deploy and run Memcached or Redis protocol-compliant server nodes in the cloud. 2 Memcached. Q: What can I cache using Amazon ElastiCache for Memcached? ... 3 Redis. Q: What is Amazon ElastiCache for Redis? ...

What is ElastiCache for Memcached cluster client with auto discovery?

ElastiCache for Memcached Cluster Client with Auto Discovery saves you time by simplifying the way an application connects to a Memcached cluster. The client connects to a single cluster endpoint and gets configuration information about other nodes.

What is the size limit for Memcache cache items?

Memcache will only accept items of 1MB or below in size for caching by default. If you are using a version of Memcache greater than 1.4.2 however, you can make use of the -I parameter when starting the daemon to override this default limit. 1


1 Answers

This page lists the parameters that we can tinker 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, then a 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 the max_item_size to the size that fits your needs. Reboot your cache cluster for this change to kickin.

enter image description here

On your local testing machine, if you have memcache installed, then you can increase the object size by adding this line at /etc/memcached.conf

# Increase object size limit
-I 128M

Then reboot your memcache with sudo service memcached restart for the changes to settle in

like image 87
Shankar ARUL Avatar answered Sep 24 '22 16:09

Shankar ARUL