inetutils 1.5 / ftpd problem: 426 Data connection: No buffer space available.

Charles Wilson cygwin@cwilson.fastmail.fm
Thu May 1 05:57:00 GMT 2008


Corinna Vinschen wrote:
> On Apr 30 01:58, Charles Wilson wrote:
>> Well, one of the differences between ftpd-1.3.2 and ftpd-1.5 is that the 
>> newer version uses mmap on the (local) file.  ftpd.c is the /only/ source 
>> file in inetutils that uses mmap.
> 
> Ok, so the ftpd using mmap is faster, one way or another.

Not according to my numbers:

mmap, topo 1, 4k buffers:  9-10 Mbps
mmap, topo 2, 4k buffers: 14-15 Mbps

NO mmap, topo 1, 4k bufs:  9-10 Mbps
NO mmap, topo 2, 4k bufs: 14-15 Mbps


>> If [disabling mmap] *does* fix the problem, it may point to an issue with cygwin-1.5's 
>> mmap implementation, or with XP's handling of the underlying 
>> NtCreateSection()...mmap is not supposed to be CPU-intensive.
> 
> There might be a bug lurking somewhere.  Could you create a very simple
> testcase which basically behaves like ftpd for debugging?

attached.

gcc -o server server.c
gcc -o client client.c

Add an entry to /etc/services on both machines, like:
     example 22725/tcp
or you could edit the two files and use a hardcoded port number, instead 
of a service name and getservbyname()

And don't forget to open a hole in your server machine's firewall for 
that port.

On the server machine, invoke as:

    $ server <filename>

This file is the one that will be transferred to the client. This works 
for me:
    $ dd if=/dev/urandom of=ReallyBigFile bs=1M count=250

On the client:

    $ client <hostname_of_server> <filename>

<filename> is where the client will save the transferred data.

server is a traditional daemon, which forks off a copy to handle each 
new connection.  That copy is the one you want to debug/strace/whatever.

With this pair of programs, I saw "sane" memory usage in all cases when 
NOT using mmap, and I saw "insane" memory usage for all mmap cases 
except when blocksize was 1k.

To switch among the various cases, edit the server.c file to 
#define/#undef HAVE_MMAP, and change the value of LARGE_TRANSFER_BLOCKSIZE.

--
Chuck

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftpd-mmap-troubles.tar.bz2
Type: application/octet-stream
Size: 5522 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20080501/25910bb9/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list