Java-Interview-Advanced/docs/distributed-system/zookeeper-distribute-lock-optimize.md
2020-04-25 19:55:58 +08:00

13 lines
509 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

![zookeeper-distribute-lock-optimize](/docs/distributed-system/images/zookeeper-distribute-lock-optimize.png)
也可以,羊群效应
如果几十个客户端同时争抢一个锁此时会导致任何一个客户端释放锁的时候zk反向通知几十个客户端几十个客户端又要发送请求到zk去尝试创建锁所以大家会发现几十个人要加锁大家乱糟糟的无序的
羊群效应
造成很多没必要的请求和网络开销,会加重网络的负载