-
1. Locking strategy suggestion
mircea.markus Jan 19, 2011 4:48 AM (in response to yelin666)Enabling deadlock detection should decrease the chance for this to happen. Do you DLD on?
-
2. Locking strategy suggestion
yelin666 Jan 19, 2011 9:55 PM (in response to mircea.markus)Thanks for the response. I'll try DLD later, and see how it helps.
-
3. Locking strategy suggestion
galder.zamarreno Jan 26, 2011 11:41 AM (in response to yelin666)Infinispan doesn't sound to be the right tool for this job. I don't see you mentioning that you store the event in Infinispan. You seem to use Infinispan simply as a distributed lock manager, in which case I think you'd be better off using JGroups' distributed lock manager. The downside though is that I don't think JGroups has DLD.
-
4. Locking strategy suggestion
yelin666 Jan 27, 2011 8:58 AM (in response to galder.zamarreno)Galder, thanks for sharing your thoughts. Based on our experience with the Infinispan lock so far, even before we saved the key/value pair to the cache (basically, get(key) returns null), we can still call lock(key) and that is nice. In our use case, we expect the lock to be event specific, and I doubt JGroups' distributed lock manager could support that. I assume Infinispan lock is still our best choice. Please let me know if my assumption is correct.
I got a turn around from another project to be able to test DLD now, what LockAcquisitionTimeout for lock in general and SpinDuration for DLD would you suggest to try? Response would be appreciated.
Manik, please chip in on this topic if you feel necessary.
-
5. Locking strategy suggestion
mircea.markus Jan 27, 2011 8:11 PM (in response to galder.zamarreno)The downside though is that I don't think JGroups has DLD.
My impression was that Bela would implement this soon. It's much easier to implement (compared with ISPN) as all the locks reside on the same server in the recommended jgroups lock protocol.
-
6. Locking strategy suggestion
mircea.markus Jan 27, 2011 8:15 PM (in response to yelin666)I got a turn around from another project to be able to test DLD now, what LockAcquisitionTimeout for lock in general and SpinDuration for DLD would you suggest to try? Response would be appreciated.
I'm afraid there's no straight answer to this: the smaller the SpinDuration the more CPU you use for DLD. It all depends on your data access pattern, key contention, transaction size (i.e. how many keys do you have per transaction). My suggestion is "measure, don't guess": try different values and see what fits you better. If you need to run distributed benchmarks consider using Radargun: radargun.sourceforge.net
-
7. Locking strategy suggestion
galder.zamarreno Feb 4, 2011 9:56 AM (in response to yelin666)...In our use case, we expect the lock to be event specific, and I doubt JGroups' distributed lock manager could support that...
I have no idea what that means...
-
8. Locking strategy suggestion
yelin666 Feb 7, 2011 9:13 AM (in response to galder.zamarreno)Basically, we'd like the lock to be key based, a lock for a specific key. Does that make sense?
For JGroups' distributed lock, is it a single global lock for everything?
-
9. Locking strategy suggestion
galder.zamarreno Feb 17, 2011 5:12 AM (in response to yelin666)Lin, I'd recommend that you check the JGroups source code, but I seriously doubt Mr Ban has implemented Distributed Locking as a single global lock.
In fact, as you can see in https://github.com/belaban/JGroups/blob/master/src/org/jgroups/blocks/DistributedLockManager.java#L224 , whenever you lock you give a lock id, so the lock is named, rather than being global.
-
10. Locking strategy suggestion
yelin666 Feb 17, 2011 10:59 AM (in response to galder.zamarreno)I did check out the JGroups distributed locking, and realized it's id based.
My question is what's the relationship between Infinispan lock and the JGroups distributed lock. We are using Infinispan for data storage anyway, so what's the cons and pros of using each of them?
-
11. Locking strategy suggestion
galder.zamarreno Feb 22, 2011 11:38 AM (in response to yelin666)There's no relationship between them. My concer was that you're using Infinispan just as a way to do cluster wide locking, without the need of doing data storage. If you need data storage, then your use case is fine, but this was not obvious from the start. Hence why I suggested JGroups if all you want to do is cluster wide locking.