Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Apr 2019 01:59:29 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Wojciech Puchar <wojtek@puchar.net>, freebsd-hackers@freebsd.org
Subject:   Re: very low performance tcp/rsh
Message-ID:  <ef440d5f-c543-148a-4e68-44b0bc62b28f@grosbein.net>
In-Reply-To: <alpine.BSF.2.20.1904292028400.48623@puchar.net>
References:  <alpine.BSF.2.20.1904292028400.48623@puchar.net>

next in thread | previous in thread | raw e-mail | index | archive | help
30.04.2019 1:30, Wojciech Puchar wrote:

> i tried
> 
> rsh -l user localhost "cat /dev/zero" >/dev/null
> 
> got 300MB/s or machine that can do memcpy at 10GB/s (with 1GB blocks - no cache) single threaded.
> 
> what limits the performance

memcpy() runs in user space while reading (pseudo) device does multiple system calls
with context switches and copying data from kernel to userland (and back while sending to the net).

Also, zero(4) device has additional and significant overhead because it needs
to clear many memory pages and it can make heavy load on VM subsystem.

Also, rsh is not optimized for multi-GB/s speeds.

If you want to measure single-threaded TCP performance,
use mdconfig to create memory "disk", put some big file there (2GB should be enought)
and run stock ftpd to send big file. Our ftpd uses sendfile() system call
that makes kernel read data from file and put it directly to TCP socket
without any kind of extra data copying and without extra context switches.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ef440d5f-c543-148a-4e68-44b0bc62b28f>