Java-Interview-Advanced/docs/distributed-system/zookeeper-distribute-lock-o...

13 lines
509 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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