I wrote a PHP script to test my memcached. What I did is that setting 100 000 items (that have 10 different values) , then get them back and check if the values are correct or not.
You can check the script at : http://pastebin.com/fb443de3
All the items I got back are correct after I run this script. Syed Ali wrote:
Did you just put an item with that 300 chars key and got it back. If so, it could have been truncated to 255 and since you didnt submit another item with the same first 255 chars in the key, you got it back... Makes sense? Regards, Zer0frequency On 4/26/09, pdah <[email protected]> wrote:Hi everybody, As far as I know the maximum key size for an item in memcached is 250 and can be extended to 255. I've just installed the lastest version of memcached on my Ubuntu and tried to set an item with length of 300 and 600. I was surprise that it was set correctly, even using get/set command, C/C++ library libmemcached or memcached extension of PHP. I checked the source code, in memcached.h : typedef struct _stritem { ................. uint8_t nkey; /* key length, w/terminating null and padding */ ................ } item; the type of key length is still uint8_t which is 1 byte, how can it manage with key length 300 and 600 ?
