2017-04-14 212 views
0

我已经搭建了一个带有树莓的samba服务器,但问题是速度非常慢。我主要用它来观看我的照片,因此每个文件的大小最多大约为5MB。树莓连接到一个千兆交换机,我通过以太网连接的PC观看照片。与Raspberry的网络共享极其缓慢

这是iperf的

[email protected] ~ $ 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秒之间变化,这太多了。

对此有何建议?

回答

0

读取磁盘/ ssd的启动速度可能很慢,几秒钟后只能达到45MB/s。所以大部分时间都可以用在初始策略中,从而确定如何从存储中读取映像文件。一旦完成,它会快速读取并发送。

+0

你知道我该如何测试这是否是问题?如果是这样,有关解决方案的任何想法? – lbedogni

+0

我尝试写入/读取文件到磁盘。和以前一样速度,所以这不应该成为问题。 – lbedogni

+0

@lbedogni,尝试读取几千个小文件,然后通过网络以尽可能少的批量写入方式发送它们。时间与阅读1个大小与大小相同的大文件。你可以通过向他们写入随机的东西来为两个实验生成文件。确保它们在写入后不被缓存。可能只需在写入文件后关闭设备。 –