麦星 - arcturus technologies- 

テクノロジー関連情報と日常的な何かを発信しています

CDNを用いたP2Pベースの大規模ファイル配信システム「Dragonfly」について

こんばんは。GoLangにハマりつつある、@うしです。

 

最近、P2Pベースのファイル配布システム「Dragonfly」について調べています。
というか、GitからソースをDLしてコードを追っかけています。

きっかけは、端的に言うと
どうやって、配信の安定性を担保しているのか?また、そのテクノロジーについて知りたいから。で、
「Dragonfly」は、配信環境、受信環境にも寄りますが、ファイルをDLするクライアント数に関係なく、
平均DL時間が安定しています。  
 

ちなみに、READMEにある記述だと …

wgetの場合、クライアントが増えるとダウンロード時間が長くなり、
wgetクライアントの数が(実験では)1200に達すると、ファイルソースはクラッシュし、
それからどのクライアントにもサービスを提供できなくなります。

とのこと  
 

つまり、「wget」や「curl」と違って、
全てのクライアントに一定時間でファイル配信が可能。という事になります。  

 

以下はコンポジションの結果を示したグラフへのリンクです。
github.com

以下は、READMEに記載がある、 「Dragonfly 」の概要と、特徴になります。  

Whats' Dragonfly ?

「Dragonfly」についてググる
"CDNを用いたP2Pベースの大規模ファイル配信システム"と出てくるのですが、
良く分からないので、調べてみました。

イントロダクションを見ると以下の様に記載があります。

  • Simple: well-defined user-facing API (HTTP), non-invasive to all container engines;

  • Efficient: CDN support, P2P based file distribution to save enterprise bandwidth;

  • Intelligent: host level speed limit, intelligent flow control due to host dection;

  • Secure: block transmission encrytion, HTTPS connection support.

GitHub ReadMeから転載

Google先生で翻訳すると…

  • シンプル:すべてのコンテナエンジンに非侵襲的な、明確に定義されたユーザー向けAPI(HTTP)。
  • 効率的:CDNサポート、企業の帯域幅を節約するためのP2Pベースのファイル配布。
  • インテリジェント:ホストレベルの速度制限、ホスト検出によるインテリジェントフロー制御。
  • セキュア:ブロック送信暗号化、HTTPS接続サポート。

とのこと。
 
 

うーん。ナルホド良くわからんけど、
取りあえず、HTTP(S)経由でP2Pでファイルを配布してくれるらしい。

そして、Dragonflyは現在、Sandbox Level Projectとして
Cloud Native Computing Foundation(CNCF)によってホストされており、
以前のJavaで記述されたバージョン(<0.3.0)からGoLngでリファクタリングされています。

 

GitHub - dragonflyoss/Dragonfly: Dragonfly is an intelligent P2P based image and file distribution system.  

Characteristics of Dragonfly

Dragonflyには以下の機能・特徴があります。

  • P2P based file distribution:
    Using P2P technology for file transmission, which can make full use of the bandwidth resources of each peer to improve download efficiency, saves a lot of cross-IDC bandwidth, especially costly cross-board bandwidth

  • Non-invasive support all kinds of container technologies:
    Dragonfly can seamlessly support various containers for distributing images.

  • Host level speed limit:
    Many downloading tools(wget/curl) only have rate limit for the current download task, but dragonfly also provides rate limit for the entire host.

  • Passive CDN:
    The CDN mechanism can avoid repetitive remote downloads. Strong consistency: Dragonfly can guarantee that all downloaded files must be consistent even if users do not provide any check code(MD5).

  • Disk protection and high efficient IO:
    Precheck Disk space, delay synchronization, write file-block in the best order, split net-read / disk-write, and so on.

  • High performance:
    Cluster Manager is completely closed-loop, which means, it does not rely on any DB or distributed cache, processing > requests with extremely high performance.

  • Exception auto isolation:
    Dragonfly will automatically isolate exception nodes(peer or Cluster Manager) to improve download stability.

  • No pressure on file source:
    Generally, as long as a few Cluster Managers download file from the source.

  • Support standard http header:
    Support http header, Submit authentication information through http header. Effective concurrency control of Registry Auth: Reduce the pressure of the Registry Auth Service.

  • Simple and easy to use:
    Very few configurations are needed.

こちらもGoogle先生に聞くと、以下の様に翻訳してくれました…

  • P2Pベースのファイル配布:
    ファイル転送にP2Pテクノロジを使用すると、ダウンロード効率を向上させるために各ピアの帯域幅リソースを最大限に活用でき、IDC間の帯域幅、特に高価なクロスボード帯域幅を大幅に節約できます。

  • 非侵襲的なあらゆる種類のコンテナ技術のサポート:
    Dragonflyは画像を配布するためにさまざまなコンテナをシームレスにサポートできます。

  • ホストレベルの速度制限:
    多くのダウンロードツール(wget / curl)は現在のダウンロードタスクに対してレート制限しかありませんが、トンボもホスト全体に対してレート制限を提供します。

  • パッシブCDN
    CDNカニズムは、繰り返しのリモートダウンロードを避けることができます。

  • 強い一貫性:
    Dragonflyは、ユーザーがチェックコード(MD5)を提供しなくても、ダウンロードされたすべてのファイルが一貫していなければならないことを保証できます。

  • ディスク保護と高効率IO:
    ディスクスペースの事前チェック、同期の遅延、ファイルブロックの最適な順序での書き込み、ネット読み取りとディスク書き込みの分割などを行います。

  • 高性能:
    Cluster Managerは完全に閉ループです。つまり、DBや分散キャッシュに依存せず、非常に高いパフォーマンスで要求を処理します。

  • 例外の自動分離:
    Dragonflyはダウンロードの安定性を向上させるために自動的に例外ノード(ピアまたはクラスタマネージャ)を分離します。

  • ファイルソースに圧力をかけない:
    一般に、少数のCluster Managerがソースからファイルをダウンロードする限り。

  • 標準のhttpヘッダーをサポートする:
    httpヘッダーをサポートする、httpヘッダーを介して認証情報を送信する。 Registry Authの効果的な同時実行制御:Registry Authサービスのプレッシャーを軽減します。

  • シンプルで使いやすい:
    必要な設定はほとんどありません。  
     
     

まぁ、コアな部分は、やはりDocker なのですが、
実際にコードを追っかけてみると楽しいので 皆さんも是非、試して見てください。