Re: features - interesting!!

2011-02-05 Thread Roberto Spadim
=] yes no lose heehe the lock_key is per pic, ipnumber_lock like: 172.16.0.254_lock= 0 or 1 or 2 172.16.0.253_lock= 0 or 1 or 2 172.16.0.252_lock= 0 or 1 or 2 172.16.0.251_lock= 0 or 1 or 2 2011/2/5 dormando dorma...@rydia.net: for data i use this: key= pic ip number_fragment lock key = pic

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/3/11 11:40 PM, Roberto Spadim wrote: LOCK (create a key-value, always return value) UNLOCK (delete key-value, if key-value=sent(key-value) delete, return before delete value, if not exist return blank or null) that's it easy not? What happens when the server holding the lock value is

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
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

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/2011 9:34 AM, Roberto Spadim wrote: What happens when the server holding the lock value is rebooted? Or needs to evict values from memory? For memcache's realpurpose those things don't affect operation because the client will reload the correct values on the next access. Where is

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
i don't see any question to say: it's not a good feature to be implemented just one thing: my scenario isn't your scenario, i need only one server, cache timeout isn't a problem, no value in cache isn't a problem, i just need a simple lock / unlock function, i will make all app relative

Re: features - interesting!!

2011-02-04 Thread Dustin
On Feb 4, 8:37 am, Roberto Spadim robe...@spadim.com.br wrote: put at main memcache code, and we can port to others memcache forks, got the quest? Our goals are quite far from this. It would be trivial for you to create an extension in the new engine branch to add lock support if you feel

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
i can´t replace PIC, i have more 2.000 unit of PIC here (a lot of money), after that i can use arm with linux for now i can just use PIC ok, no help from forum, i will try to code by my self, if code looks good could i send to memcache mail list and try to make it 'default' in source code?

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/2011 11:25 AM, Dustin wrote: easy? with it i can have 3 or more send/receive removed from my pic18f4550 code (save a lot of rom for me) Are you sure you're not looking for a job server (gearmand, beanstalkd, etc...)? Perhaps your mistake is in doing any of the processing on your

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
nice =] but it don´t have lock too :/ today i´m using repcache, i never have problem with lose of information (i´m using a good ups too) the only problem is the PIC code is consuming a lot of ROM and time (many network i/o) and i can´t use many PICs in the same time since the network band is just

Re: features - interesting!!

2011-02-04 Thread Marc Bollinger
I get why you may strike out on your own and write an extension to memcached that does exactly what you want (kind of, there _are_ better tools, as mentioned), that's precisely what open source is about. I do not get why you're so persistent about getting changes that the community and maintainers

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
since all (php, ruby, c and many others) client library are compatible with memcached, a new function in memcache will be faster reported to client libraries =), that´s why i want it at memcached, not at repcache or membase or memcachedb or anyother it´s a client and server change, it´s not just

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/2011 11:40 AM, Roberto Spadim wrote: nice =] but it don´t have lock too :/ Isn't this a lock? http://wiki.membase.org/display/membase/getl+extended+operations I guess it is new and experimental. Then again, yours would be too. today i´m using repcache, i never have problem with lose

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
yes but i will need many network packets to work first add second getl it could work with only one lock 2011/2/4 Les Mikesell lesmikes...@gmail.com: On 2/4/2011 11:40 AM, Roberto Spadim wrote: nice =] but it don´t have lock too :/ Isn't this a lock?

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
ehehe i know that there´s many others lock server, but i don´t have ROM on my PIC18f4550 to put two libraries =( it would be nice if i had a ARM or a x86 :/, but i don´t have :( if i use memcache i could do it with my PIC 2011/2/4 Adam Lee a...@fotolog.biz: Yes.  I'm starting to feel like a

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/2011 12:40 PM, Roberto Spadim wrote: ehehe i know that there´s many others lock server, but i don´t have ROM on my PIC18f4550 to put two libraries =( it would be nice if i had a ARM or a x86 :/, but i don´t have :( if i use memcache i could do it with my PIC Do you already have enough

Re: features - interesting!!

2011-02-04 Thread Adam Lee
You don't need two libraries. As I said, a lot of these products already speak the memcached protocol or, alternatively, something like redis would provide you all of the functionality that you need from memcached plus the features that you're requesting (key-value store with replication,

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
i will learn more about redis, i didn´t see a lock server with cache yet my today app work today, but it´s not very good/fast (i have a network bootneck today) i rewrite to redis protocol is very poor :( if i can´t do anythink i will try a proxy between memcache and client and implement lock and

Re: features - interesting!!

2011-02-04 Thread Adam Lee
Do you only need the lock in order to do transaction groups? If so, redis supports those out of the box: http://rediscookbook.org/pipeline_multiple_commands.html http://rediscookbook.org/pipeline_multiple_commands.htmlIf, though, you're actually trying to build locks, check out WATCH:

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/2011 1:16 PM, Roberto Spadim wrote: i will learn more about redis, i didn´t see a lock server with cache yet my today app work today, but it´s not very good/fast (i have a network bootneck today) i rewrite to redis protocol is very poor :( if i can´t do anythink i will try a proxy between

Re: features - interesting!!

2011-02-04 Thread Dustin
On Feb 4, 9:30 am, Roberto Spadim robe...@spadim.com.br wrote: i can´t replace PIC, i have more 2.000 unit of PIC here (a lot of money), after that i can use arm with linux for now i can just use PIC ok, no help from forum, i will try to code by my self, if code looks good could i send to

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
it´s not the case, i will study redis maybe a protocol change can solve the problem lock is just for computer world it´s a mix of pic(gpio + logic) and computer it´s work very well, to problem is pic have low cpu memory and rom, in future i will change to ARM/x86 i will try other solution maybe a

Re: features - interesting!!

2011-02-04 Thread Dustin
On Feb 4, 12:20 pm, Roberto Spadim robe...@spadim.com.br wrote: it´s not the case, i will study redis maybe a protocol change can solve the problem lock is just for computer world it´s a mix of pic(gpio + logic) and computer it´s work very well, to problem is pic have low cpu memory and rom,

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
problem: today i need 4 packets to make 'lock'/'unlock' using memcache i need to use less ROM/CPU/RAM/network at client side solution: 1) make server side lock function with 2 packet (with atomic operations) 2) make a proxy if function = lock/unlock, proxy make these packets to server (i don't

Re: features - interesting!!

2011-02-04 Thread Les Mikesell
On 2/4/11 9:56 PM, Roberto Spadim wrote: problem: today i need 4 packets to make 'lock'/'unlock' using memcache i need to use less ROM/CPU/RAM/network at client side What's the big picture here? If you want your client to do less work, why not run a web service on the server that not only

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
i'm trying to separe some cpu use (i know cpu for servers is not a problem) but since the problem is 'easy' i'm trying to keep logic at microcontroller, if i port all logic to server, is better to use ARM or x86 at microcontroller side (i will spend less money - i still with 2000 pic in stock :/ )

Re: features - interesting!!

2011-02-04 Thread dormando
problem: today i need 4 packets to make 'lock'/'unlock' using memcache i need to use less ROM/CPU/RAM/network at client side solution: 1) make server side lock function with 2 packet (with atomic operations) 2) make a proxy if function = lock/unlock, proxy make these packets to server (i

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
pic use memcache as a RAM memory first i lock memcache (with my today lock function) set a key to 0 i read data from pic, and put at memcache after 128 writes i put a sum (save this sum at pic internal memory) total bytes is about 1MB(1048576 bytes) (pic don't have this memory, it's a ADC read

Re: features - interesting!!

2011-02-04 Thread dormando
pic use memcache as a RAM memory first i lock memcache (with my today lock function) set a key to 0 i read data from pic, and put at memcache after 128 writes i put a sum (save this sum at pic internal memory) total bytes is about 1MB(1048576 bytes) (pic don't have this memory, it's a ADC

Re: features - interesting!!

2011-02-04 Thread Roberto Spadim
for data i use this: key= pic ip number_fragment lock key = pic ip number_lock Then there's no locking, and multiple PIC's can use memcached in parallel? yes many pic's in parallel and a app at server side read in multiget all data :) That sounds like a win/win to me, if gross :) what's win/win

Re: features - interesting!!

2011-02-04 Thread dormando
for data i use this: key= pic ip number_fragment lock key = pic ip number_lock Shouldn't need the lock_key, then? That sounds like a win/win to me, if gross :) what's win/win ? hehehe It's when there's no lose.

Re: features - interesting!!

2011-02-03 Thread Roberto Spadim
LOCK should be something like this: ?php // type=0 - unlock // type=1 - lock // client_name must change (use sessionID + username) function memcache_flock($memcache_obj,$key,$type=0,$client_name='1',$timeout=0){ $ret=memcache_add($memcache_obj,$key,$client_name,false,$timeout);

Re: features - interesting!!

2011-02-03 Thread Adam Lee
Here's one I hacked together a while back, though, as I said before, I recommend using something better suited to the job... BTW, this thing uses a few of our utility classes, but it should be very simple to drop in replacements. public class GlobalLock { public GlobalLock(String lockType,

Re: features - interesting!!

2011-02-03 Thread Adam Lee
I'm not sure what you mean that it's client-based. Sure, the logic is on the client, as a lot of things are with memcached, but the CAS is enforced by the server. Doesn't seem like it's functionally any different than adding the same function on the server side, since the client would just be

Re: features - interesting!!

2011-02-03 Thread Roberto Spadim
not identical... if you need less network latency, server side is better... no doubt... like CAS we could make a LOCK system (just LOCK/UNLOCK, with timeout, and just allow change lock/unlock if content of lock = content value sent on memcache client) 2011/2/3 Adam Lee a...@fotolog.biz: I'm not

Re: features - interesting!!

2011-02-03 Thread Adam Lee
awl On Feb 3, 2011 11:11 PM, Roberto Spadim robe...@spadim.com.br wrote: not identical... if you need less network latency, server side is better... no doubt... like CAS we could make a LOCK system (just LOCK/UNLOCK, with timeout, and just allow change lock/unlock if content of lock = content

Re: features - interesting!!

2011-02-03 Thread Adam Lee
sure, latency would be lower, but i still believe that they would be functionally identical. regardless, i believe that this isn't really something that memcached should do. it gives you the tools necessary to implement it without adding functionality tangential to its core purpose. if you want

Re: features - interesting!!

2011-02-03 Thread Roberto Spadim
can anyone make it at server side? i don't know anything about server side source code (yet) 2011/2/4 Adam Lee a...@fotolog.biz: awl On Feb 3, 2011 11:11 PM, Roberto Spadim robe...@spadim.com.br wrote: not identical... if you need less network latency, server side is better... no doubt...

Re: features - interesting!!

2011-02-03 Thread Roberto Spadim
i agree with client built into it but let's think memcached like a nosql server key-value but like a sql server we can implement locks with a key-value like we can implement locks... it's just a function over existent structure, don't need modifications and it's (memcached) very fast i think for a

Re: features - interesting!!

2011-02-03 Thread Dustin
On Feb 3, 9:29 pm, Roberto Spadim robe...@spadim.com.br wrote: can anyone make it at server side? i don't know anything about server side source code (yet) How, exactly, does this reduce the cost or increase the performance of your production app to make this change? How many concurrent

Re: features - interesting!!

2011-02-03 Thread Dustin
On Feb 3, 9:40 pm, Roberto Spadim robe...@spadim.com.br wrote: 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. with these three

Re: features - interesting!!

2011-01-30 Thread Roberto Spadim
nice (repcache and memcachedb work well...) is the lock daemon generic? (not filesystem based) 2011/1/29 Dustin dsalli...@gmail.com: On Jan 28, 9:39 pm, rspadim rspa...@gmail.com wrote: hi guys, there's a async replication project (repcached) that is very interesting, could we implement it in

features - interesting!!

2011-01-29 Thread rspadim
hi guys, there's a async replication project (repcached) that is very interesting, could we implement it in main source code? at compile time we could select from repcached or memcached could we make it sync and/or async? http://repcached.sourceforge.net/

Re: features - interesting!!

2011-01-29 Thread Dustin
On Jan 28, 9:39 pm, rspadim rspa...@gmail.com wrote: hi guys, there's a async replication project (repcached) that is very interesting, could we implement it in main source code? at compile time we could select from repcached or memcached could we make it sync and/or