> How, exactly, does this reduce the cost or increase the performance >of your production app to make this change? How many concurrent locks >are you holding, and what percentage of your total traffic is this? >By how many machines do you estimate you could reduce your memcached >server farm by introducing this new functionality? i'm using microcontroller at client side... PIC18F4550, my client is very slow for cpu/ram/rom, with many get/add/delete i can't get a lock of speed, with only one call LOCK i could have more speed. get my problem? i will not improve server farm, i will improve clients with a new feature and reduce my RAM/CPU/ROM usage. network isn't a problem i'm using 10mbits (it's fast for a microcontroller) my server is a core2duo with 2gb of ram (a lot...) my client can run at 40mhz... (it's nothing compared with core2guo 2ghz...)
>> but like a sql server we can implement locks >> with a key-value like we can implement locks... > There's no facility in memcached to create a reliable lock. > You can't store anything you ever expect to get back. that's not true, if i just put and never could read why use memcache? i can store and get back many information, i can't get back only if timeout, if cache is full and memcache delete my key or if memcache get down, or if i couldn't put data in cache (memory full when add) > There's no facility in memcached to create a reliable lock. we will implement a simple lock, like CAS was implemented, but we don't need a lot of parsers just a string compare function... client send: LOCK key=abc value=cde server receive, check if key exist, key not exist and can add to cache(memory not full) add and return value. can't add (memory full) return error code. key alread exist return current key value client send: UNLOCK key=abc value =cde server receive, check if key exist, is key and value = client key and client value? delete key, return client key value. doesn't exist? return client key value. exists but value!=client value? return current value. >Why don't you solve your problem with a tool designed to solve your >problem? i solved and it´s not as fast as i want, with memcache i think i could remove network problems and ROM/RAM/CPU problem (i'm using PIC18F4550 as client... think about it! a microcontroller with a mysql protocol? i don't have ROM for it! for memcache i have =D ) i solved with a lot of memcache get/add/replace/delete (just one lock, could be very fast for my application) > There are plenty of sql servers and nosql servers to choose from. client protocol is very heavy for a microcontroller (PIC18F4550) protocol is very slow and not optimized as memcache ========== >> CAS was not a core feature, but it's very nice to have CAS at server >> side... why not a LOCK function? > incr was also not a core feature at one point. It, and CAS have >meaning in the scope of a cache since they're about manipulating data >in a cache. lock is a manipulate data too.... ========== >>What happens when the server holding the lock value is rebooted? Or needs to >>evict values from memory? For memcache's real >purpose those things don't >>affect operation because the client will reload the correct values on the >>next access. Where is the >persistent backing store for this value? if elockd/lockd/any other lock server die, what happen? (non vollatile or vollatile? it's a app problem not memcache problem, app must know what happen, just it. with memcache we have volllatile, with memcachedb we have non vollatile, put at main memcache and i will work with memcachedb and repcache to sync this new feature at others memcache forks who will use memcache for lock and don't want loose keys change memcache command line to don't delete cache keys if cache is full non volatille? we port it to memcachedb (i could make this job), replication? port it to repcache put at main memcache code, and we can port to others memcache forks, got the quest? with only one client side library we can implement cache and lock system think about a microcontroller running a ethernet library and memcache (i have one - PIC18F4550) it could make global locks! easly, my client side is poor performace, put all cpu/memory/network costs at server and i have a big performace improvement! i do it today (but it's not as fast as i want) ========== >> timeout could work too (it's key-value based) >Memcache is a cache, not a key-value store. nice, it's a cache (can loose information) it's a key-value store with timeout and volatille data, right? define cache! (volatile memory? how to cache? based on key-value? based on memory address? it's a key-value store! working as a cache! it could be a address-value store too, but it's a key-value store... and can loose information, app must know this!) i use memcache for store some values with pic18f4550 and it's very good, since my pic have low memory and my server have a lot of memory ======== >that's it easy not? tell me, it's easy not? if not , i will study and wait more time to have this feature, if it's easy please help me and work in put LOCK and UNLOCK function on memcache -- Roberto Spadim Spadim Technology / SPAEmpresarial