web-dev-qa-db-ja.com

keepalived: `fo`および` mh` lvsスケジューリングアルゴリズムとは何ですか?

パラメータvirtual_server.lvs_sched in keepalived.confは、説明が見つからない2つのオプションfomdをサポートしています。

誰かがその意味を知っていますか?

3
Younes

virtual_server.lvs_schedに許可される値は、IPVS(IP仮想サーバー)スケジューラーの名前です。 keepalived manページ は、スケジューラのサポートされている名前としてrr|wrr|lc|wlc|lblc|sh|mh|dh|fo|ovf|lblcr|sed|nqに言及しており、元のIPVSドキュメントで説明されているよりもかなり多くなっています。

カーネルソース を覗いて、これらの新しいスケジューラーが何であるかを確認する必要がありました。

  • fo is "Weighted Fail Over"-他のすべてのスケジューリングモジュールは、何らかの形の負荷分散を実装していますが、これにより、シンプルなフェイルオーバーソリューションが提供されます。加重フェイルオーバースケジューリングアルゴリズムは、現在利用可能な最大の加重を持つサーバーにネットワーク接続を転送します。
    出典: https://patchwork.ozlabs.org/patch/390597/

  • mh は「マグレブハッシュ」です

    /* The mh algorithm is to assign a preference list of all the lookup
     * table positions to each destination and populate the table with
     * the most-preferred position of destinations. Then it is to select
     * destination with the hash key of source IP address through looking
     * up a the lookup table.
     *
    

    アルゴリズムの詳細は次のとおりです。 .4コンシステントハッシュ

ipvasdmmanページ からの完全性のために、他のスケジューラーの説明を提供します:

          scheduling-method   Algorithm for allocating TCP connections and
          UDP datagrams to real servers.  Scheduling algorithms are imple-
          mented as kernel modules. Ten are shipped with the Linux Virtual
          Server:

          rr - Robin Robin: distributes jobs equally amongst the available
          real servers.

          wrr - Weighted Round Robin: assigns jobs to real servers propor-
          tionally to there real  servers’  weight.  Servers  with  higher
          weights  receive  new  jobs first and get more jobs than servers
          with lower weights. Servers with equal weights get an equal dis-
          tribution of new jobs.

          lc  -  Least-Connection:  assigns more jobs to real servers with
          fewer active jobs.

          wlc - Weighted Least-Connection: assigns more  jobs  to  servers
          with  fewer  jobs  and  relative  to  the  real  servers’ weight
          (Ci/Wi). This is the default.

          lblc - Locality-Based Least-Connection:  assigns  jobs  destined
          for  the same IP address to the same server if the server is not
          overloaded and available; otherwise assign jobs to servers  with
          fewer jobs, and keep it for future assignment.

          lblcr   -   Locality-Based  Least-Connection  with  Replication:
          assigns jobs destined for the same IP address to the  least-con-
          nection  node  in  the server set for the IP address. If all the
          node in the server set are over loaded, it picks up a node  with
          fewer  jobs  in the cluster and adds it in the sever set for the
          target. If the server set has not been modified for  the  speci-
          fied  time, the most loaded node is removed from the server set,
          in order to avoid high degree of replication.

          dh - Destination Hashing: assigns jobs to servers through  look-
          ing  up a statically assigned hash table by their destination IP
          addresses.

          sh - Source Hashing: assigns jobs to servers through looking  up
          a statically assigned hash table by their source IP addresses.

          sed  -  Shortest  Expected Delay: assigns an incoming job to the
          server with the shortest expected delay. The expected delay that
          the  job  will  experience  is (Ci + 1) / Ui if  sent to the ith
          server, in which Ci is the number of jobs on the the ith  server
          and Ui is the fixed service rate (weight) of the ith server.

          nq  -  Never Queue: assigns an incoming job to an idle server if
          there is, instead of waiting for a fast one; if all the  servers
          are busy, it adopts the Shortest Expected Delay policy to assign
          the job.
2
HBruijn