delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/01/01:58:03

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48195BCB.40201@cwilson.fastmail.fm>
Date: Thu, 01 May 2008 01:57:31 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: inetutils 1.5 / ftpd problem: 426 Data connection: No buffer space available.
References: <3ee066b40804292141k764cb66al5ac97c6fb8111bb AT mail DOT gmail DOT com> <48180A91 DOT 5080001 AT cwilson DOT fastmail DOT fm> <20080430085035 DOT GM23852 AT calimero DOT vinschen DOT de>
In-Reply-To: <20080430085035.GM23852@calimero.vinschen.de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------060203070109030302080906
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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


--------------060203070109030302080906
Content-Type: application/octet-stream;
 name="ftpd-mmap-troubles.tar.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="ftpd-mmap-troubles.tar.bz2"

QlpoOTFBWSZTWQrVeyoAEKl/ht/ekjB7///fv//f/v////4AAIAQAAhgG17x
yL7nHuzs514A4gKAL0DeM9c913eevb1GzupdjSkh6iADuaoikookEqlLZY1j
enve4acbDoMoSmlNMppo0TRqaeEGo009IZMTQyAAAA0xMgDQ0AGmgIEEJlSe
UBpoDQ0AAaAAAAADQ9RoA40NDQ0A0BiBoDIAANNAA0AyAAABhJpRCNRGCmGR
CPRlHpDMo0NNADTQNBoaA0ABkBEoiZIPQJomk8KZPU9T1DRgamhpoyABo0aM
AjE00000EiIQCaaCZBA0TE0SP0k2U9TTag9QAGh+qMygNGahpk752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IXemfIzHFRxWBKPQ+0KmRNwA32KPIUBVQbGjYqotrgYDHK0KBazBsFL1Xxb
QpocNd+j5d49N178dQorhRYokbMqMK4UhFCCFapFj8FiiwvKpSY+0rRUwcX5
VriEQoxyIu9Nr5zBzGZKGMLdZs+soNWZMERhGYBtACzMLCU2cCWdhBD2GNKA
BaloKUpQLkSioVEQjCMFw2SM1IxRWwlQAMXMjBk5RlTNlJEYN0m8oTJEIqhx
o4mTBFjNLbpNLROEkNUhpDE9lFOZAsLE+8dShQYkWdVvEYB0UQTBCbizmiU4
1IyVqblKaK3oVBp9ergLx7hMLYtOAFQDfHuzekIvQC87EJGF59EiCCpQNxgF
UoGcWRoeIdrqV8gDNQyL9ssyMwkowq1AstpY3XhM6xUysYhCEHLBbYNIrQC/
qjFZl4rFwxQIuGhJhkRYiWdrkcU51rKZpECwTMqFk1ASIMBrzHrXmPbwMjEE
uKEafrPekhrqdOwCu8whA9sdgPtMC8XaY2UpWS3QyAvmdzAUi610TG9GIwRm
fq/WZBeM2BpKGgx07PIJLSBEkIKncqMlnvmpqWkBVhZmhNaa6eQTMU5wOn1K
EJynHumCanoSo9bPspncknb5Ds3KdTW3m0Mo5BzMWcqnQRfCzL9EpBbJAZn1
oF9Z/NyRE0/S6GcgW6YgGBx71JIf/F3JFOFCQCtV7Kg=


--------------060203070109030302080906
Content-Type: text/plain; charset=us-ascii

--
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/
--------------060203070109030302080906--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019