Sujet : Re: Named pipes vs. Unix sockets
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.miscDate : 22. Nov 2024, 09:38:20
Autres entêtes
Message-ID : <lqau7sF8btnU4@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Pan/0.161 (Hmm2; be402cc9; Linux-6.12.0)
On 22 Nov 2024 07:29:16 GMT, vallor <
vallor@cultnix.org> wrote in
<
lqaq6cF8btnU3@mid.individual.net>:
However, the speed appears to be limited by dd in my examples -- setting
a block size to fill the pipe/packets seems to increase throughput:
$ nc -l -U -N /tmp/socket > /dev/null & time -p ( dd if=/dev/zero
count=$[1024*1024*4] bs=1024 | nc -U -N /tmp/socket > /dev/null )
Realized the bottleneck would be the pipe between dd and nc, so wrote
a program to connect to /tmp/socket and spew data at it -- it sends
46950 212992-byte buffers (9999974400 bytes) in 2.41 seconds.
(4149366971 bytes/second, or 4.1GB/s).
(The default "MTU" for a Linux Unix socket connection
is 212992 bytes. Default pipe size is 8*512 bytes.)
-- -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti OS: Linux 6.12.0 Release: Mint 21.3 Mem: 258G "Profanity is the one language all programmers know best."