【问题标题】:Network sharing with Raspberry extremely slow与 Raspberry 的网络共享极慢
【发布时间】:2017-04-14 09:10:52
【问题描述】:

我已经用 raspberry 设置了一个 samba 服务器,但问题是速度非常慢。我主要用它来观看我的照片,所以每个文件的大小最大约为 5MB。树莓派连接到千兆交换机,我通过以太网连接的电脑观看照片。

这是iperf

pi@raspberrypi ~ $ iperf -s -p 10000
------------------------------------------------------------
Server listening on TCP port 10000
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.1.200 port 10000 connected with 192.168.1.112 port 52907
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   111 MBytes  92.7 Mbits/sec
[  5] local 192.168.1.200 port 10000 connected with 192.168.1.112 port 53695
[  5]  0.0-10.0 sec   108 MBytes  89.9 Mbits/sec
[  4] local 192.168.1.200 port 10000 connected with 192.168.1.112 port 55175
[  4]  0.0-10.0 sec   109 MBytes  91.1 Mbits/sec
[  5] local 192.168.1.200 port 10000 connected with 192.168.1.112 port 55760
[  5]  0.0-10.0 sec   110 MBytes  92.2 Mbits/sec
[  4] local 192.168.1.200 port 10000 connected with 192.168.1.112 port 55972
[  4]  0.0-10.0 sec   110 MBytes  92.1 Mbits/sec

考虑到 pi 的 100 Mbit/s 卡,这完全没问题。

我从 USB 硬盘读取照片,通过它我达到大约 45 MB/s。因此,我希望在大约半秒内下载一张照片,这是不正确的。目前,时间在 3 到 5 秒之间变化,这太长了。

对此有何建议?

【问题讨论】:

    标签: networking raspbian raspberry-pi2 samba


    【解决方案1】:

    从磁盘/ssd 读取的数据启动速度可能很慢,几秒钟后才稳定到 45MB/s。所以大部分时间可以花在初始策略上,弄清楚如何从存储中读取图像文件。完成后,它会快速读取并发送。

    【讨论】:

    • 你知道我该如何测试这是否是问题所在?如果是,您对解决方案有什么想法吗?
    • 我尝试将文件写入/读取到磁盘。速度和以前一样,所以这应该不是问题。
    • @lbedogni,尝试读取几千个小文件并通过网络以尽可能少的批量写入发送它们。与读取 1 个与小文件大小总和大致相同的大文件的时间。您可以通过向它们写入随机内容来为这两个实验生成文件。确保它们在写入后没有被缓存。可能只是在您写入文件后关闭设备。
    猜你喜欢
    • 1970-01-01
    • 2014-02-07
    • 1970-01-01
    • 1970-01-01
    • 2020-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-28
    相关资源
    最近更新 更多