kkfnui

rsync jar 包可以增量同步

  •  
  •   kkfnui · Mar 30, 2018 · 3900 views
    This topic created in 2968 days ago, the information mentioned may be changed or developed.

    用 maven 重新编译工程,让后用 rsync 将 jar 同步到线上的服务器是,发现速度异常的快。

    做了下列测试:

    • 将服务器 jar 包删除,同步速度会慢很多
    • 本地删除 jar 重新编译,rsync 显示发送字节数 300 多 KB

    猜测,rsync 针对 jar 这种压缩文件的传输做了优化,仅仅会同步 jar 包中有更新的文件。

    4 replies    2018-03-31 10:24:51 +08:00
    oott123
        1
    oott123  
       Mar 30, 2018   ❤️ 1
    是的,rsync 的手册上写道:

    rsync is a program that behaves in much the same way that rcp does, but
    has many more options and uses the rsync remote-update protocol to
    greatly speed up file transfers when the destination file is being
    updated.

    The rsync remote-update protocol allows rsync to transfer just the dif-
    ferences between two sets of files across the network connection, using
    an efficient checksum-search algorithm described in the technical
    report that accompanies this package.

    参考: https://rsync.samba.org/tech_report/tech_report.html
    oott123
        2
    oott123  
       Mar 30, 2018   ❤️ 1
    事实上,rsync 对任何只变化了一小部分的文件同步都是十分效率的。
    julyclyde
        3
    julyclyde  
       Mar 30, 2018
    没有说明发送方向,只说“将服务器上 jar 删除”、“将本地 jar 删除”
    简直是自言自语
    kkfnui
        4
    kkfnui  
    OP
       Mar 31, 2018
    @julyclyde 有说明:

    用 rsync 将 jar 同步到线上的服务器

    第一句就是。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2589 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:41 · PVG 08:41 · LAX 17:41 · JFK 20:41
    ♥ Do have faith in what you're doing.