Named pipes vs. Unix sockets (was: Re: Are We Back to the "Wars" Now ?)

Liste des Groupes 
Sujet : Named pipes vs. Unix sockets (was: Re: Are We Back to the "Wars" Now ?)
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.misc
Date : 22. Nov 2024, 08:29:16
Autres entêtes
Message-ID : <lqaq6cF8btnU3@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.161 (Hmm2; be402cc9; Linux-6.12.0)
On 22 Nov 2024 07:02:47 GMT, vallor <vallor@cultnix.org> wrote in
<lqaoknF8btnU2@mid.individual.net>:

On Fri, 22 Nov 2024 06:37:06 -0000 (UTC), Lawrence D'Oliveiro
<ldo@nz.invalid> wrote in <vhp8qi$12m83$2@dont-email.me>:
 
On 22 Nov 2024 06:09:05 GMT, vallor wrote:
 
Doesn't the named pipe connection work through the filesystem code?
That
could add overhead.
 
No. The only thing that exists in the filesystem is the “special file”
entry in the directory. Opening that triggers special-case processing
in
the kernel that creates the usual pipe buffering/synchronization
structures (or links up with existing structures created by some prior
opening of the same special file, perhaps by a different process), not
dependent on any filesystem.
 
I just tried creating a C program to do speed tests on data transfers
through pipes and socket pairs between processes. I am currently
setting
the counter to 10 gigabytes, and transferring that amount of data
(using
whichever mechanism) only takes a couple of seconds on my system.
 
So the idea that pipes are somehow not suited to large data transfers
is
patently nonsense.
 
Can't use named pipes on just any filesystem -- won't work on NFS for
example, unless I'm mistaken.
 
Hard to believe NFS could stuff that up, but there you go ...
 
Just tested NFS, and named pipes work there.
 
$ time -p ( dd if=/dev/zero of=test count=$[1024*1024] ) & cat test > /
dev/null
[1] 38859
1048576+0 records in
1048576+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 0.918945 s, 584 MB/s
real 0.92
user 0.16
sys 0.76
 
NFS vers 4.1.

$ nc -l -U -N /tmp/socket > /dev/null & time -p ( dd if=/dev/zero
count=$[1024*1024*2] | nc -U -N /tmp/socket )
[1] 40284
2097152+0 records in
2097152+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.03617 s, 527 MB/s
real 2.03
user 0.47
sys 3.60
[1]+  Done                    nc -l -U -N /tmp/socket > /dev/null

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 )
[1] 41764
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 4.02026 s, 1.1 GB/s
real 4.02
user 0.89
sys 7.11

$ time -p ( dd if=/dev/zero of=test count=$[1024*1024*4] bs=$[8*512]) &
cat test > /dev/null
[1] 41282
4194304+0 records in
4194304+0 records out
17179869184 bytes (17 GB, 16 GiB) copied, 4.43357 s, 3.9 GB/s
real 4.43
user 0.54
sys 3.88

$ ulimit -p
8
(pipesize in 512-byte blocks)

(Now I'm off to find out the MTU for Unix sockets...)

--
-v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
   OS: Linux 6.12.0 Release: Mint 21.3 Mem: 258G
   ""This is a job for.. AACK! WAAUGHHH!! ...someone else." - Calvin"

Date Sujet#  Auteur
18 Nov 24 * Are We Back to the "Wars" Now ?80186282@ud0s4.net
18 Nov 24 +* Re: Are We Back to the "Wars" Now ?3D
20 Nov 24 i`* Re: Are We Back to the "Wars" Now ?2186282@ud0s4.net
20 Nov 24 i `- Re: Are We Back to the "Wars" Now ?1D
18 Nov 24 +- Re: Are We Back to the "Wars" Now ?1Pancho
18 Nov 24 +- Re: Are We Back to the "Wars" Now ?1Richard Kettlewell
18 Nov 24 +* Re: Are We Back to the "Wars" Now ?52Rich
18 Nov 24 i`* Re: Are We Back to the "Wars" Now ?51Phillip Frabott
20 Nov 24 i `* Re: Are We Back to the "Wars" Now ?50Lawrence D'Oliveiro
21 Nov 24 i  `* Re: Are We Back to the "Wars" Now ?49Phillip Frabott
21 Nov 24 i   `* Re: Are We Back to the "Wars" Now ?48Lawrence D'Oliveiro
21 Nov 24 i    `* Re: Are We Back to the "Wars" Now ?47Phillip Frabott
21 Nov 24 i     +* Re: Are We Back to the "Wars" Now ?20Richard Kettlewell
22 Nov 24 i     i`* Re: Are We Back to the "Wars" Now ?19Phillip Frabott
22 Nov 24 i     i +* Re: Are We Back to the "Wars" Now ?17Lawrence D'Oliveiro
22 Nov 24 i     i i`* Re: Are We Back to the "Wars" Now ?16vallor
22 Nov 24 i     i i +* Re: Are We Back to the "Wars" Now ?10Lawrence D'Oliveiro
22 Nov 24 i     i i i`* Re: Are We Back to the "Wars" Now ?9vallor
22 Nov 24 i     i i i `* Named pipes vs. Unix sockets (was: Re: Are We Back to the "Wars" Now ?)8vallor
22 Nov 24 i     i i i  `* Re: Named pipes vs. Unix sockets7vallor
22 Nov 24 i     i i i   +- Re: Named pipes vs. Unix sockets1Lawrence D'Oliveiro
22 Nov 24 i     i i i   `* Re: Named pipes vs. Unix sockets5Phillip Frabott
22 Nov 24 i     i i i    +* Re: Named pipes vs. Unix sockets3Lawrence D'Oliveiro
22 Nov 24 i     i i i    i`* Re: Named pipes vs. Unix sockets2Phillip Frabott
23 Nov 24 i     i i i    i `- Re: Named pipes vs. Unix sockets1Lawrence D'Oliveiro
3 Dec 24 i     i i i    `- Re: Named pipes vs. Unix sockets1Lawrence D'Oliveiro
22 Nov 24 i     i i `* Re: Are We Back to the "Wars" Now ?5Rich
23 Nov 24 i     i i  +* Re: Are We Back to the "Wars" Now ?3vallor
23 Nov 24 i     i i  i+- Re: Are We Back to the "Wars" Now ?1Rich
23 Nov 24 i     i i  i`- Re: Are We Back to the "Wars" Now ?1Lawrence D'Oliveiro
26 Nov 24 i     i i  `- Pipes v. FIFOs (was: Are We Back to the "Wars" Now ?)1Geoff Clare
22 Nov 24 i     i `- Re: Are We Back to the "Wars" Now ?1Richard Kettlewell
21 Nov 24 i     `* Re: Are We Back to the "Wars" Now ?26Lawrence D'Oliveiro
22 Nov 24 i      `* Re: Are We Back to the "Wars" Now ?25186282@ud0s4.net
22 Nov 24 i       `* Re: Are We Back to the "Wars" Now ?24Lawrence D'Oliveiro
23 Nov 24 i        `* Re: Are We Back to the "Wars" Now ?23186282@ud0s4.net
23 Nov 24 i         `* Re: Are We Back to the "Wars" Now ?22Lawrence D'Oliveiro
23 Nov 24 i          `* Re: Are We Back to the "Wars" Now ?21186282@ud0s4.net
23 Nov 24 i           +* Re: Are We Back to the "Wars" Now ?6Lawrence D'Oliveiro
23 Nov 24 i           i`* Re: Are We Back to the "Wars" Now ?5Carlos E.R.
23 Nov 24 i           i +* Re: Are We Back to the "Wars" Now ?2Fritz Wuehler
24 Nov 24 i           i i`- Re: Are We Back to the "Wars" Now ?1Carlos E.R.
23 Nov 24 i           i `* Re: Are We Back to the "Wars" Now ?2Lawrence D'Oliveiro
24 Nov 24 i           i  `- Re: Are We Back to the "Wars" Now ?1Carlos E.R.
23 Nov 24 i           `* Re: Are We Back to the "Wars" Now ?14The Natural Philosopher
23 Nov 24 i            `* Re: Are We Back to the "Wars" Now ?13Lawrence D'Oliveiro
24 Nov 24 i             `* Re: Are We Back to the "Wars" Now ?12186282@ud0s4.net
24 Nov 24 i              +- Re: Are We Back to the "Wars" Now ?1Lawrence D'Oliveiro
24 Nov 24 i              `* Re: Are We Back to the "Wars" Now ?10Rich
24 Nov 24 i               `* Re: Are We Back to the "Wars" Now ?9Lew Pitcher
24 Nov 24 i                +- Re: Are We Back to the "Wars" Now ?1Rich
24 Nov 24 i                `* Re: Are We Back to the "Wars" Now ?7Richard Kettlewell
24 Nov 24 i                 +- Re: Are We Back to the "Wars" Now ?1Carlos E.R.
24 Nov 24 i                 +- Re: Are We Back to the "Wars" Now ?1Rich
25 Dec 24 i                 `* Re: Are We Back to the "Wars" Now ?4186282@ud0s4.net
27 Dec 24 i                  +- Re: Are We Back to the "Wars" Now ?1Richard Kettlewell
28 Dec 24 i                  +- Re: Are We Back to the "Wars" Now ?1Lawrence D'Oliveiro
5 Jan 25 i                  `- Re: Are We Back to the "Wars" Now ?1Jerry Peters
20 Nov 24 `* Re: Are We Back to the "Wars" Now ?22Lawrence D'Oliveiro
3 Dec 24  `* Re: Are We Back to the "Wars" Now ?21186282@ud0s4.net
3 Dec 24   +* Re: Are We Back to the "Wars" Now ?3Lawrence D'Oliveiro
4 Dec 24   i`* Re: Are We Back to the "Wars" Now ?2186282@ud0s4.net
4 Dec 24   i `- Re: Are We Back to the "Wars" Now ?1Lawrence D'Oliveiro
14 Dec 24   `* Re: Are We Back to the "Wars" Now ?17Pancho
14 Dec 24    `* Re: Are We Back to the "Wars" Now ?16root
14 Dec 24     `* Re: Are We Back to the "Wars" Now ?15The Natural Philosopher
17 Dec 24      `* Re: Are We Back to the "Wars" Now ?14Geoff Clare
18 Dec 24       `* Re: Are We Back to the "Wars" Now ?13Lawrence D'Oliveiro
18 Dec 24        `* Re: Are We Back to the "Wars" Now ?12186282@ud0s4.net
18 Dec 24         `* Re: Are We Back to the "Wars" Now ?11Rich
18 Dec 24          +* Re: Are We Back to the "Wars" Now ?5Robert Riches
18 Dec 24          i`* Re: Are We Back to the "Wars" Now ?4Rich
19 Dec 24          i `* Re: Are We Back to the "Wars" Now ?3Robert Riches
19 Dec 24          i  `* Re: Are We Back to the "Wars" Now ?2Rich
19 Dec 24          i   `- Re: Are We Back to the "Wars" Now ?1D
18 Dec 24          `* Re: Are We Back to the "Wars" Now ?5Richard Kettlewell
18 Dec 24           `* Re: Are We Back to the "Wars" Now ?4Rich
18 Dec 24            `* Re: Are We Back to the "Wars" Now ?3John Ames
18 Dec 24             +- Re: Are We Back to the "Wars" Now ?1Rich
18 Dec 24             `- Re: Are We Back to the "Wars" Now ?1Richard Kettlewell

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal