Use consul for distributed lock like zookeeper is this possible

701 views
Skip to first unread message

ruslan usifov

unread,
Jun 18, 2016, 5:00:24 PM6/18/16
to Consul
Hello

Is this a good idea to use caosul instead zookeeper for distributed lock service

Chris Stevens

unread,
Jun 18, 2016, 7:31:48 PM6/18/16
to Consul
I use and can recommend Consul for distributed locking.

Here's an example in 3 lines of code:

And a demo app and environment of the same:

ruslan usifov

unread,
Jun 20, 2016, 2:23:27 PM6/20/16
to Consul
Interested in how big the bandwidth in this case? 

воскресенье, 19 июня 2016 г., 2:31:48 UTC+3 пользователь Chris Stevens написал:

Chris Stevens

unread,
Jun 21, 2016, 12:31:05 PM6/21/16
to Consul
I don't have any specifics, but it should be minimal.

The lock requests are simple for each operation. Basically:
HTTP PUT /v1/session
HTTP PUT /v1/kv

I would say that most use cases (up to 1000s of locks) should be fine.

- Chris

ruslan usifov

unread,
Jun 22, 2016, 8:16:42 AM6/22/16
to Consul
Hello

1k per sec this is total lock counts or per node? If you don't mind, can you describe how busy consul in this situation in cpu persentages? And can you provide you harware spec? 

вторник, 21 июня 2016 г., 19:31:05 UTC+3 пользователь Chris Stevens написал:
Reply all
Reply to author
Forward
0 new messages