C# ThreadPool 用于写入 SSD 磁盘

发布于 2024-10-22 08:21:02 字数 117 浏览 1 评论 0原文

我有一个线程池将数据写入 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

血之狂魔 2024-10-29 08:21:02

如果您需要执行随机 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).

贱贱哒 2024-10-29 08:21:02

解决此问题的最佳方法是实际分析不同的池大小。您选择的实际设置将取决于您正在执行的 I/O 的性质,当然还有所述 I/O 的并发性。

理论上,应该表现
通过更多线程改进?

与传统的基于主轴的驱动器不同,SSD 具有出色的随机读/写性能,因此将受益于多个并发线程在其上执行 I/O。

SSD 如何处理并发写入?
就这一点而言,还有并发读取?

由于没有移动部件,只是对各个(内存)位置的数据访问,因此几乎不需要随机读/写的排队,除非超出了驱动器的读/写 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.

Theoretically, should performance
improve with more threads?

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.

How do SSDs handle concurrent writes?
And also concurrent reads, for that matter?

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文