C# ThreadPool 用于写入 SSD 磁盘
我有一个线程池将数据写入 SSD 磁盘。 (Windows XP、C#) 我想选择池大小来优化性能。理论上, 更多线程是否应该提高性能? SSD 如何处理并发写入? 就这一点而言,还有并发读取?
谢谢!
I have a thread pool writing data to an SSD disk. (windows XP, c#)
I would like to choose a pool size to optimize performance. Theoretically,
should performance improve with more threads? How do SSDs handle concurrent writes?
And also concurrent reads, for that matter?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您需要执行随机 io 操作,您可能需要确保驱动器在 AHCI 中运行,因为 AHCI 的高并发随机性能通常比 IDE 更快
(参见 http ://benchmarkreviews.com/index.php?option=com_content&task=view&id=505&Itemid=38&limit=1&limitstart=3)。
该评论还表明,并发随机读取和写入(4K-64Trd 结果)比仅使用单个线程(4K 结果)更快。
If you need to perform random io operations, you might want to ensure you're drive is running in AHCI, as random performance with high concurrency is usually faster with AHCI than IDE
(see http://benchmarkreviews.com/index.php?option=com_content&task=view&id=505&Itemid=38&limit=1&limitstart=3).
This review also shows that concurrent random reads and writes (4K-64Trd Results) are faster than when using only a single thread (4K results).
解决此问题的最佳方法是实际分析不同的池大小。您选择的实际设置将取决于您正在执行的 I/O 的性质,当然还有所述 I/O 的并发性。
与传统的基于主轴的驱动器不同,SSD 具有出色的随机读/写性能,因此将受益于多个并发线程在其上执行 I/O。
由于没有移动部件,只是对各个(内存)位置的数据访问,因此几乎不需要随机读/写的排队,除非超出了驱动器的读/写 IO 数。
The best way to go about solving this problem is by actually profiling different pool sizes. The actualy settings you choose will depend on the nature of I/Os you are performing and of course the concurrency of said I/Os.
SSDs unlike conventional spindle based drives have great random read/write performance and therefore will benefit (greatly) from having multiple concurrent threads perform I/O on them.
Since there are no moving parts, just data access to various (memory) locations, there is very little queing of random reads/writes that is needed, unless the drive's IOs/s for reads/writes is exceeded.