Long pause.

2003-08-26 Thread Rogier Wolff

Hi everyone, 

I'm trying to rsync a large directory. After pondering on the 
list-of-files, it's now more or less doing nothing. It's
running for over 4 hours now, not doing anything except
eating CPUtime on the destination for over half an hour. I don't
know what it was doing before that. 

The stdout of the rsync reported: 
4675350 files to consider

(which is about right)

On the source machine it's using about 470 Mb of memory.
On the destination machine it's using 800M of memory and growing.
The rsync process on the destination machine  is not doing
ANY system calls. Oh! There ARE a lot of hardlinks involved. 

The destination machine IS swapping a bit:

   procs  memoryswap  io system cpu
 r  b  w   swpd   free   buff  cache  si  sobibo   incs  us  sy  id
 2  0  0 803564   2820660   6788 1272 120  1272   120 2896   172   3  34  63
 1  0  0 803180   2848660   6788 992 632   992   632 3358   163   2  35  63
 1  0  0 802860   2844604   6668 1160 360  1160   364 3156   180   1  30  69
 1  0  0 802888   2816604   6668 916 420   916   424 2795   179   4  28  68
 1  0  0 802452   2760604   6668 1348   0  1348 0 2805   180   1  34  65
 0  1  0 802484   2840604   6668 932 304   932   308 2601   188   2  31  67
 1  0  0 802304   2832604   6668 1164 364  1164   364 3165   149   1  27  72
 1  0  0 802128   2820604   6668 1036 364  1036   364 2909   133   3  29  68
 1  0  0 801728   2804604   6668 1424 164  1424   168 3292   165   2  27  71
 3  0  0 801456   2808600   6672 1016 264  1016   264 2682   154   7  24  69
 1  1  0 801580   2828600   7048 940 112  1008   128 2377   298  41  35  24
 2  0  0 801528   2780600   7228 1108   0  1288 0 2725   201   2  25  73
 2  0  0 801488   2744600   7636 656   0  1064 0 2237   294   1  25  74
 1  1  0 801568   2852600   7952 716   0  1032   128 2430   285   1  25  74
 2  1  0 801616   2780596   8464 540   0   784 0 1642   279  34  16  50
 2  1  0 801576   3844596   8568 656   0  102824 2308   419  12  32  57
 1  1  0 801404   2808596   8896 708   0  1036 0 2180   252   2  21  77
 0  2  0 801336   3080600   8744 844 136  1008   144 2335   207   1  21  78
 0  1  1 801372   2820608   8764 960 568   988   564 2799   176   1  28  71
 1  0  0 801204   2772608   8656 576 180   576   184 2141   150   1  21  78


Is this normal?

Is there a way that I can estimate how much longer this is going to
take. (A day: fine. A week: Not ok.) Will rsync use MORE memory? I
have 200m of swap free right now, but if I should expect it to double
its memory use once more, I will have to add some swap to make it 
happy. Right now I can monitor it, but I'll need some sleep
in the next 16 hours or so... ;-)

Roger. 

-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
 Linux is like a wigwam -  no windows, no gates, apache inside! 
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Oops more testing was required....

2003-06-18 Thread Rogier Wolff
On Wed, Jun 18, 2003 at 09:09:59PM +1000, Martin Pool wrote:
 On 17 Jun 2003, Rogier Wolff [EMAIL PROTECTED] wrote:
  
  Oops. Missed one line in the last patch
 
 Thankyou.  That looks good.
 
 If we're going to make this more accurate it might be worthwhile to
 actually look at how long we really did sleep for, and use that to
 adjust time_to_sleep rather than resetting to zero.
 
 Also I'd prefer the variable be called micros_to_sleep or
 us_to_sleep.  Small point I know.

OK. Agreed. 

If I'm going to do gettimeofday calls, I might just as well keep a
variable that keeps the time until we've used our quotum. 

Whenever we're ready to sleep, we'll get the current time, and only
sleep for the difference.

The trouble is, that if we end up using 5 seconds worth of CPU time, 
we should not suddenly try to catch up for those whole 5 seconds 

I like to set bwlimit to about 90% of my link capacity. This causes
rsync not to fill the link: filling the link causes my provider to
drop my packets. Also rsync won't fill my queues leading to higher
latencies on interactive traffic.

But if we allow bursting of those 5 seconds that we didn't have any
data, we'll fill the link to the brim for 50 seconds! (if there
suddenly is a nice supply of fresh data) This is undesirable. So, I'm
still thinking on how to make this more accurate, but prevent big
bursts. I'm considering not allowing more than bwlimit of
backlog. (c.f. leaky bucket bandwidth limiting in the packet filtering
world)

Roger. 

 
  diff -ur rsync-2.5.6.orig/io.c rsync-2.5.6/io.c
  +++ rsync-2.5.6/io.cTue Jun 17 23:43:49 2003
  @@ -416,10 +416,19 @@
* use a bit less bandwidth than specified, because it doesn't make up
* for slow periods.  But arguably this is a feature.  In addition, we
* ought to take the time used to write the data into account.
  + *
  + * During some phases of big transfers (file XXX is uptodate) this is
  + * called with a small bytes_written every time. As the kernel has to
  + * round small waits up to guarantee that we actually wait at least
  + * the requested number of microseconds, this can become grossly
  + * inaccurate. We therefore keep a cumulating number of microseconds
  + * to wait, and only actually perform the sleep when the rouding
  + * becomes insignificant. (less than 10%) -- REW.
**/
   static void sleep_for_bwlimit(int bytes_written)
   {
  struct timeval tv;
  +   static int time_to_sleep = 0; 
   
  if (!bwlimit)
  return;
  @@ -427,9 +436,13 @@
  assert(bytes_written  0);
  assert(bwlimit  0);
  
  -   tv.tv_usec = bytes_written * 1000 / bwlimit;
  -   tv.tv_sec  = tv.tv_usec / 100;
  -   tv.tv_usec = tv.tv_usec % 100;
  +   time_to_sleep += bytes_written * 1000 / bwlimit; 
  +
  +   if (time_to_sleep  10) return;
  +
  +   tv.tv_sec  = time_to_sleep / 100;
  +   tv.tv_usec = time_to_sleep % 100;
  +   time_to_sleep = 0; 
   
  select(0, NULL, NULL, NULL, tv);
   }
 
 -- 
 Martin 

-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currently in such an  * 
* excursion: The stable situation does not include humans. ***
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


efficiency issue with rsync.....

2003-06-17 Thread Rogier Wolff

Hi rsync team, 

I thought that rsync would try to overlap computing and IO on both
machines. 

I'm rsyncing a large tree (18G) and am keeping an eye on that. 
Suddenly my side completely stopped. No IO visible, no CPU
time spent. The otherside was doing 100% CPU. Then the other
side started to do disk IO. Then suddenly the activities moved
over to my side, and I saw things moving again in the -v --progress
output. 

The transfer happened to hit my spam mailbox, 400Mb of mostly-stable
data. I probably rewrote the mailbox yesterday, having changed some
flags on mails somewhere in the middle. 

Note: This is NOT a request: Please go and fix. Just an I noticed
that it might be possible to make it more efficient. Feel free to 
keep this in mind when performing further development. 

(Still rsync is a very good tool, transferring the 17G of data in 
a couple of hours)

Oh, another thing: When two files are almost the same, (e.g. I just
added something to the end of a mailbox) the bandwidth of the link
is not fully used while the counters are running quickly. Is this
unavoidable the machine simply won't generate enough work to
keep the link busy or is there a bug in the limit bandwidht to XX
code? (I limit to 30k per second, and I see rsync doing lots of small 
sleeps. If you try to sleep for 100 usec, you'll actually be woken up 
by the kernel after a whopping 20 msec.)

Roger. 

-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currently in such an  * 
* excursion: The stable situation does not include humans. ***
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html