delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/30/01:59:26

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48180A91.5080001@cwilson.fastmail.fm>
Date: Wed, 30 Apr 2008 01:58:41 -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>
In-Reply-To: <3ee066b40804292141k764cb66al5ac97c6fb8111bb@mail.gmail.com>
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

antony baxter wrote:

>> Unfortunately, with XP SP2, Cygwin 1.5 as the server machine, I get
>> pretty much the same symptoms with each of the above ftpds serving up
>> a 350mb file:
>>
>> 1. In all cases, the ftpd process' memory usage increases to ~350mb,
>> 2. As the buffer value decreases, the process' cpu usage increases
>> (ftpd-1k.exe used about 75% of the cpu vs. about 10% for ftpd-8k.exe),
>> 3. Performance jumped around (ftpd-1k transferred the file in
>> 90seconds, ftpd-4k in 166 seconds, ftp-8k in 114 seconds on a wired
>> network)
> 
> Quick addendum: I copied over in.ftpd.exe from another Cygwin
> installation running inetutils 1.3.2 and symlinked it to ftpd on my
> server; using that to serve the same file, memory usage sticks at
> 3500kb, cpu usage never rises about 5%, and the file was delivered in
> 194 seconds.

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.

So, I recompiled with HAVE_MMAP turned off (but still using 4k chunks). 
Give this a try:

http://cygwin.cwilson.fastmail.fm/ITP/ftpd-no-mmap-4k.exe.bz2

I get behavior here which is very similar to what I reported for the 
4k-WITH-mmap version:
   (1) sane memory profile
   (2) topology one, 9-10 Mbps 2-3% cpu
   (3) topology two, 14-15 Mbps, 4-6% cpu [*]

I'm not sure what benefit mmap has in this case -- unless you can 
exploit some zero-copy kernel code for transferring data from disk to 
ethernet device. But I don't think Windows has anything like that. I 
certainly don't *see* any benefit, in my limited testing on this set of 
hardware.

If this *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.

--
Chuck

[*] However, with the mmap'ed, 4k buffer version, I also saw only 4-6% 
CPU utilization on Vista, cygwin-1.7.  So, YMMV.



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

- Raw text -


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