V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
thinkxen
V2EX  ›  Linux

向/tmp目录写入文件测试速度有问题

  •  
  •   thinkxen · Jul 24, 2013 · 3581 views
    This topic created in 4673 days ago, the information mentioned may be changed or developed.
    在一台机器上测试的时候突然发现这样一个问题

    [root@localhost]# dd if=/dev/zero of=test bs=64k count=512 oflag=dsync
    512+0 records in
    512+0 records out
    33554432 bytes (34 MB) copied, 0.979878 seconds, 34.2 MB/s

    [root@localhost]# dd if=/dev/zero of=/tmp/test bs=64k count=512 oflag=dsync
    512+0 records in
    512+0 records out
    33554432 bytes (34 MB) copied, 6.51435 seconds, 5.2 MB/s

    想请高手指点一下~~~
    5 replies    1970-01-01 08:00:00 +08:00
    samuel
        1
    samuel  
       Jul 24, 2013 via Android   ❤️ 1
    数据量太小。不足以测出真实的性能,第二次测试可能是不巧赶上脏页回写了
    thinkxen
        2
    thinkxen  
    OP
       Jul 24, 2013
    @samuel 十分感谢,加大测试数据以后速度差不多正常了,但是为什么每次写入/tmp/test就会降到10M以内,而不写如/tmp就会在30M以上呢?
    samuel
        3
    samuel  
       Jul 25, 2013
    没注意到路径有不同,不好意思- - 那么,你第二条命令确定是在/tmp目录下执行的么?
    nybux
        4
    nybux  
       Jul 25, 2013
    两个目录的磁盘类型一样嘛?
    thinkxen
        5
    thinkxen  
    OP
       Jul 25, 2013
    @samuel 我如果在/tmp下执行第一条命令,速度也非常差跟直接执行第二条命令一样~~~
    在任何地方执行第二条命令也都是一样的,在除了/tmp的其他位置执行第一条命令就是30M左右


    @nybux 一样的,我其他的服务器测试都正常~~~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3029 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 15:14 · PVG 23:14 · LAX 08:14 · JFK 11:14
    ♥ Do have faith in what you're doing.