读书人

硬盘写下大小的合理性

发布时间: 2013-01-06 15:44:48 作者: rapoo

硬盘写入大小的合理性
比如我有10G的东西要写入硬盘,我每次做write操作时,write多大的数据最合理,使得我写整个1OG的数据速度最快。哪位大侠给我点参考?
[解决办法]
http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx
[解决办法]
这个需要自己去测试,别人不知道你的硬件指标和系统环境
[解决办法]
你找个工具跑一下文件基准测试啊, 这种顺序写一般 64K左右的缓存就够了, 我一个硬盘在128K最快, 175M/秒, 一个硬盘在 64K 最快, 40M/秒...

[解决办法]
写入硬盘的速度取决于写入文件后文件在硬盘上的碎片分布。(RAMDISK和SSD固态硬盘不在此列)
用contig可以事先在硬盘上规划一块指定大小的连续无碎片的文件。然后覆盖写此文件应该是最快的。基本和写入大小无关。


Contig v1.6 - Makes files contiguous
Copyright (C) 1998-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

Contig is a utility that defragments a specified file or files.
Use it to optimize execution of your frequently used files.

Usage:
contig [-a] [-s] [-q] [-v] [existing file]
or contig [-f] [-q] [-v] [drive:]
or contig [-v] -n [new file] [new file length]

-a: Analyze fragmentation
-f: Analyze free space fragmentation
-q: Quiet mode
-s: Recurse subdirectories
-v: Verbose

Contig can also analyze and defragment the following NTFS metadata files:
$Mft
$LogFile
$Volume
$AttrDef
$Bitmap
$Boot
$BadClus
$Secure
$UpCase
$Extend

读书人网 >C++

热点推荐