Questions tagged [distributed-lock]

53 questions
60
votes
6 answers

Distributed Lock Service

Which distributed lock service would you use? Requirements are: A mutual exclusion (lock) that can be seen from different processes/machines lock...release semantics Automatic lock release after a certain timeout - if lock holder dies, it will…
ripper234
  • 222,824
  • 274
  • 634
  • 905
13
votes
5 answers

Distributed lock manager for Python

I have a bunch of servers with multiple instances accessing a resource that has a hard limit on requests per second. I need a mechanism to lock the access on this resource for all servers and instances that are running. There is a restful…
Jay
  • 2,519
  • 5
  • 25
  • 42
7
votes
1 answer

Lock on redis cluster

I have a Redis cluster of 3 master nodes and each master has corresponding slave nodes. I would like to acquire a lock on the cluster to perform some write operations and then release the lock. From what I've read is - To connect to a cluster we…
7
votes
3 answers

Distributed locking in .NET

I'm looking for recommendations for a locking mechanism that will work across multiple machines. In my case I basically just want to be able to start a service on 2 machines and have one block until the other finishes as a simple way to insure…
hackerhasid
  • 11,699
  • 10
  • 42
  • 60
6
votes
3 answers

How to lock redis cluster for an application in java

I've two java applications (app1, app2). Both applications are using JedisCluster client for Redis cluster. app1 write or read data from Redis cluster. app2 is like a scheduler which only writes some data to Redis cluster. it runs after a fixed time…
Md Shihab Uddin
  • 541
  • 5
  • 13
6
votes
0 answers

ApacheCurator distributed locking - performance

We are currently evaluating apache-curator for distributed locking use case. Below is our test case: public class Test { private static CuratorFramework client = CuratorFrameworkFactory.newClient("zook.company.com", new…
Amit Dalal
  • 642
  • 8
  • 20
4
votes
0 answers

How to do stock reduction for a list of items in shopping cart using distributed lock and SQL transaction to ensure consistency

Question: I wrote a Sell() function which do stock reduction for a list goods in user's shopping cart. Assume there will be thousands of request within a second for those goods. Since we need to improve the throughput and make sure the service is…
W.W.G
  • 93
  • 2
  • 6
4
votes
0 answers

Using ZooKeeper for distributed locks?

I need a distributed lock service which can support ~1000 locks (mostly for different lock names) per second. I wonder if someone has used ZooKeeper to implement distributed locks in production before. If so, can you please share some of the best…
yuyang
  • 1,511
  • 2
  • 15
  • 40
4
votes
1 answer

In Hazelcast, is it possible to use clustered locks that do _not_ care about the local thread that performs the lock/unlock operations?

Hazelcast locks (such as http://www.hazelcast.com/docs/1.9.4/manual/multi_html/ch02s07.html) as I understand it behave the same way as the Java concurrency primitives but across the cluster. The makes it possible to use to synchronize between thread…
SoftMemes
  • 5,602
  • 4
  • 32
  • 61
3
votes
1 answer

Hazelcast CP Subsystem FencedLock memory usage

Setup: Hazelcast: 3.12.3 Spring Boot: 2.1.6 Java: 1.8 Args: -XX:+UseG1GC Xms7g -Xmx7g These are running in Docker: openjdk:8 they run in dedicated vmware nodes CentOS 7.5.1804 I have 7 nodes in total that form a hazelcast cluster. 5 of them are…
3
votes
1 answer

Curator Hierarchy Locking (overlapping locks)

I was able to successfully get lock on /ads/lock/0-test1 and then couldn't get a lock on /ads/lock How can I solve this? InterProcessMutex lock1 = new InterProcessMutex(client, "/ads/lock/0-test1"); if(lock1.acquire(30000, TimeUnit.MILLISECONDS)){ …
3
votes
1 answer

What is the recommended way of creating a distributed Lock with Redis on Azure?

I'm looking to create a distributed Lock within Redis on Azure for our multi-instance Worker Role. I need a way of creating "critical sections" for which only a single thread can have access at a time across multiple-instances of the Worker Role. I…
oatsoda
  • 2,088
  • 2
  • 26
  • 49
2
votes
1 answer

Hazelcast: What object is it ok to use for a distributed lock key?

For the Hazelcast.getLock(Object key) method, what is the expected/acceptable key object? For instance, is it okay to use a String to refer to this lock from different nodes in the cluster? Or does it have to be a distributed object of some…
Jake
  • 15,007
  • 22
  • 70
  • 86
2
votes
2 answers

Spring Integration Distributed Locks: conceptual consistency of TTL as compared to Redisson's lease time

This is a follow up question of: https://github.com/spring-projects/spring-integration/issues/8687 As discussed in the above link, Spring Integration Distributed Lock's concept of TTL is meant for cross-process only, not for threads in the same…
2
votes
1 answer

Distributed Lock - Using fencing token for preventing concurrent writes to a network file

I am reading the Designing Data Intensive Application book. In chapter 8, it discusses the use of Fencing Token for preventing concurrent writes to a network file. The mechanism states that the a Lock service can give out Fencing Tokens, and the…
1
2 3 4