PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 12, 2022

[FIXED] What is the max length for key in Elasticache Memcached?

 November 12, 2022     amazon-elasticache, java, memcached     No comments   

Issue

We use elasticache-java-cluster-client-1.0.61.0.jar for connecting to Elasticache Memcached client. I noticed that there is restriction in code on max length for key - 250 bytes. Is it possible to overwrite it in both client and Memcached?


Solution

memcached limits the key length to 250 bytes. The only way to change that is by modifying memcached.h and recompiling. Of course you cannot recompile your memcached on ElastiCache.

The common pattern is for you to hash (say with SHA1) your keys. Actually, some memcached clients do this for you by default.

Or consider moving to Amazon ElastiCache for Redis, Redis has a max key size of 512MB.



Answered By - LeoMurillo
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing