[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [imapsync] speed problem for large mails


From Stefan Schmidt <jsj at jsj dot dyndns dot org>
Subject Re: [imapsync] speed problem for large mails
Date Fri, 9 Jan 2009 18:45:50 +0100

On Friday 09 January 2009 17:33:52 Gilles LAMIRAL wrote:
> Hello Stefan,
>
> > > Is there the same issue from localhost to localhost ?
> >
> > Yes.
> > I tested with a Dual PIII 1.5GHz, and a Core2Duo 2.33, where in the
> > first test the destination Cyrus was in a VMware guest.
>
> This is not real localhost to localhost.
> VMware guest is a special environment.

Oh, forgot to explain the "Yes". I tested from localhost to localhost, on my Core2Duo, the same cyrus, but two different accounts. 
The other tested machines were explained above.

> > > What are your kernel, perl release, architecture ?
> >
> > 2.6.18 with perl 5.8.8 for testing purposes with a different perl
> > version
> > 2.6.25.18 for the source cyrus 2.3.11
> > 2.6.27.7 for destination cyrus with perl 5.10.0
>
> Architectures ?

Damn it, I forgot:
Mainly 32bit, but my localhost test was x86_64 -- a little bit faster, but the same decay in transfer speed over time with the huge mail.

> Test without vmware. Some users reported issues with vmware, solved
> without vmware.

Trust me, not VMware related. The strace shows clearly, that there is a buffer, which is increase by 4096 bytes for every read, using 
mremap. This works pretty fast, as long as the buffer is small, but when it grows to, lets say, 20MB, for every 4096 byte increase the 20MB 
have to be moved in RAM from A to B. This slows things down heavily.

========
17:36:45 mmap2(NULL, 26308608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xacfec000
17:36:45 munmap(0xacfec000, 26308608)   = 0
17:36:45 mmap2(NULL, 52756480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xab6b3000
17:36:45 read(3, "\27\3\1\20 ", 5)      = 5
17:36:45 read(3, "6\323\4\345H\255\247x\33S\30\252\252\340\300 \207Ij5\37\223\"\244G\376\215\254\351\\Gr"..., 4128) = 4128
17:36:45 munmap(0xab6b3000, 52756480)   = 0
17:36:45 mremap(0xae903000, 26308608, 26312704, MREMAP_MAYMOVE) = 0xae903000
17:36:45 mremap(0xb1b2c000, 26312704, 26316800, MREMAP_MAYMOVE) = 0xb1b2c000
17:36:45 mremap(0xb3dd5000, 26312704, 26316800, MREMAP_MAYMOVE) = 0xb3dd5000
17:36:45 mmap2(NULL, 26312704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xacfeb000
17:36:45 munmap(0xacfeb000, 26312704)   = 0
17:36:45 mmap2(NULL, 52752384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xab6b4000
17:36:45 read(3, "\27\3\1\20 ", 5)      = 5
17:36:45 read(3, "\4\300\371\255\250\361\200\326\204\27\3462\301\202\335\224_|\267\245\263~*\6\255\360\253\247\6m>V"..., 4128) = 
4128
17:36:45 munmap(0xab6b4000, 52752384)   = 0
17:36:45 mremap(0xae903000, 26312704, 26316800, MREMAP_MAYMOVE) = 0xae903000
17:36:45 mremap(0xb1b2c000, 26316800, 26320896, MREMAP_MAYMOVE) = 0xb1b2c000
17:36:45 mremap(0xb3dd5000, 26316800, 26320896, MREMAP_MAYMOVE) = 0xb3dd5000
17:36:45 mmap2(NULL, 26316800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xacfea000
17:36:45 munmap(0xacfea000, 26316800)   = 0
17:36:45 mmap2(NULL, 52748288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xab6b5000
17:36:45 read(3, "\27\3\1\20 ", 5)      = 5
========


> > > Try:
> > >   --split1 100
> >
> > This will not help, as the problem is one large mail.
>
> The problem is memory and I've seen strange things,
> have a try.

OK. But does not change this behaviour.

Meanwhile I found out, that the first mremap is done, when the buffer grows larger than 176KB.
I will dig deeper...

Greetings,

Stefan
-- 
Stefan Schmidt		jsj at jsj dot dyndns dot org