I'm trying to pipe extremely high speed data from one application to another using 64-bit CentOS6. I have done the following benchmarks using dd
to discover that the pipes are holding me back and not the algorithm in my program. My goal is to achieve somewhere around 1.5 GB/s.
我正在尝试使用64位CentOS6将极高速数据从一个应用程序传输到另一个应用程序。我使用dd完成了以下基准测试,发现管道阻碍了我而不是程序中的算法。我的目标是达到大约1.5 GB / s的速度。
First, without pipes:
首先,没有管道:
dd if=/dev/zero of=/dev/null bs=8M count=1000
1000+0 records in
1000+0 records out
8388608000 bytes (8.4 GB) copied, 0.41925 s, 20.0 GB/s
Next, a pipe between two dd processes:
接下来,两个dd进程之间的管道:
dd if=/dev/zero bs=8M count=1000 | dd of=/dev/null bs=8M
1000+0 records in
1000+0 records out
8388608000 bytes (8.4 GB) copied, 9.39205 s, 893 MB/s
Are there any tweaks I can make to the kernel or anything else that will improve performance of running data through a pipe? I have tried named pipes as well, and gotten similar results.
我可以对内核或其他任何可以改善通过管道运行数据的性能的调整吗?我也尝试过命名管道,并得到了类似的结果。
1 个解决方案
#1
5
Have you tried with smaller blocks?
你试过较小的块吗?
When I try on my own workstation I note successive improvement when lowering the block size. It is only in the realm of 10% in my test, but still an improvement. You are looking for 100%.
当我在自己的工作站上试用时,我注意到在降低块大小时的连续改进。在我的测试中,它仅在10%的范围内,但仍然是一种改进。你正在寻找100%。
As it turns out testing further, really small block sizes seem to do the trick:
事实证明,进一步测试,非常小的块大小似乎可以解决问题:
I tried
我试过了
dd if=/dev/zero bs=32k count=256000 | dd of=/dev/null bs=32k
256000+0 records in
256000+0 records out
256000+0 records in
256000+0 records out
8388608000 bytes (8.4 GB) copied8388608000 bytes (8.4 GB) copied, 1.67965 s, 5.0 GB/s
, 1.68052 s, 5.0 GB/s
And with your original
和你的原创
dd if=/dev/zero bs=8M count=1000 | dd of=/dev/null bs=8M
1000+0 records in
1000+0 records out
1000+0 records in
1000+0 records out
8388608000 bytes (8.4 GB) copied8388608000 bytes (8.4 GB) copied, 6.25782 s, 1.3 GB/s
, 6.25203 s, 1.3 GB/s
5.0/1.3 = 3.8 so that is a sizable factor.
5.0 / 1.3 = 3.8因此这是一个相当大的因素。
#1
5
Have you tried with smaller blocks?
你试过较小的块吗?
When I try on my own workstation I note successive improvement when lowering the block size. It is only in the realm of 10% in my test, but still an improvement. You are looking for 100%.
当我在自己的工作站上试用时,我注意到在降低块大小时的连续改进。在我的测试中,它仅在10%的范围内,但仍然是一种改进。你正在寻找100%。
As it turns out testing further, really small block sizes seem to do the trick:
事实证明,进一步测试,非常小的块大小似乎可以解决问题:
I tried
我试过了
dd if=/dev/zero bs=32k count=256000 | dd of=/dev/null bs=32k
256000+0 records in
256000+0 records out
256000+0 records in
256000+0 records out
8388608000 bytes (8.4 GB) copied8388608000 bytes (8.4 GB) copied, 1.67965 s, 5.0 GB/s
, 1.68052 s, 5.0 GB/s
And with your original
和你的原创
dd if=/dev/zero bs=8M count=1000 | dd of=/dev/null bs=8M
1000+0 records in
1000+0 records out
1000+0 records in
1000+0 records out
8388608000 bytes (8.4 GB) copied8388608000 bytes (8.4 GB) copied, 6.25782 s, 1.3 GB/s
, 6.25203 s, 1.3 GB/s
5.0/1.3 = 3.8 so that is a sizable factor.
5.0 / 1.3 = 3.8因此这是一个相当大的因素。