Dragonfly
Dragonfly copied to clipboard
Can I Only enabled CDN, Not enabled P2P
Why you need it?
In the enterprise production environment, using P2P will increase the complexity of the problem investigation, poor control will also lead to some inexplicable network problems, such as different data centers and network strategies are not open. Is it possible to add a switch to enable only the CDN function of supernode and turn off the P2P function of dfget. In the enterprise production environment, using P2P will increase the complexity of problem checking, and poor control will lead to some inexplicable network problems, such as different data centers and network strategies are not opened.
// 在企业生产环境中,使用P2P,会增加查问题的复杂度,控制不好还会导致一些莫名其妙的网络问题,例如不同的数据中心和网络策略未开通等。
How it could be?
Add a switch to support turning off the p2p function. Add a switch to support turning off P2P function.
// 增加一个开关,支持关闭p2p功能。
Other related information
!!!!WE STRONGLY ENCOURAGE YOU TO DESCRIBE YOUR ISSUE IN ENGLISH!!!!
You can use dfget
with flag --pattern cdn
to disable p2p
and just use the CDN feature.
if pattern set cdn, download very slow. environment is registry + dragonfly 1.0.1.
my config is cat /etc/dragonfly/dfdaemon.yml
registry_mirror: remote: https://registry.local.com certs: null insecure: true direct: false proxies: [] hijack_https: null port: 65001 hostIp: 127.0.0.1 certpem: "" keypem: "" verbose: false maxprocs: 4 dfget_flags: ["--pattern","cdn"] supernodes: [] ratelimit: 200MB workHome: /root/.small-dragonfly localrepo: /root/.small-dragonfly/dfdaemon/data dfpath: /opt/dragonfly/df-client/dfget logConfig: maxSize: 0 maxBackups: 0 path: "" localIP: "" peerPort: 0 streamMode: false
dfget.log has log : 2020-05-26 07:04:36.001 ERRO sign:3297-1590476322.082 : failed to parse rate in pull rate: dial tcp4 10.108.192.153:0: connect: connection refused
chang pattern to p2p is fast.
Where did I configure it wrong? @lowzj
The bottleneck of cdn
pattern is the network bandwidth of supernode, dfget will downloading data only from supernode in cdn
pattern.
The bottleneck of
cdn
pattern is the network bandwidth of supernode, dfget will downloading data only from supernode incdn
pattern.
i know, but unavailable after set cdn pattern. why? maybe my config is wrong. can you show a cdn demo? run on kubernetes
i know, but unavailable after set cdn pattern. why? maybe my config is wrong. can you show a cdn demo? run on kubernetes
The data flow is: registry --> supernode --> dfget
in cdn
pattern`.
Could you please paste the whole logs of a downloading task in dfclient.log?
@cgzchen I think this is related to another bug I have filed. It appears when in CDN mode that the part scheduling on the supernode seems to hang, and the scheduling failure is worse the higher you have the bandwidth throttle. It will sometimes completely hang, and it is an issue with the supernode pulling the pieces. We use the CDN mode for the same reason. The only workaround I have right now is to run 1 single dfdaemon, with the supernode, and then we point all the docker daemons at that one instance. P2P is still turned on, but since there are no other nodes it only pulls from the CDN, but, it also pulls some parts itself so it caches in 2 places. If you increase the expiration on the dfget data (to an hour or whatever) it works just as well, when a daemon requests the data from it, it either serves it out of the /data/back files from the p2p pull that went to source, or it pulls it from the CDN. It isn't as efficient as just using CDN only and the scheduling working, but it does work, and does perform well enough for our use case and is not actually p2p traffic, it is a work around.