Print

Print


Hi Andy,

Just to chime in as I did some of the investigation that sparked this discussion. My understanding of the max2cache setting is that any request larger than that will bypass the cache. In this scenario, I assumed that the memory proxy will act as a non-caching proxy, and I would expect the performance to be similar to that of a non-caching proxy (on top of the same underlying storage).

I thought I had confirmed this in testing by verifying that the client read requests (e.g. the 8MB requests from xrdcp) are passed through to the origin when read size is greater than max2cache. I also tried to verify that changes to the memory proxy page size and preread setting had no effect on performance of these 'bypass' reads, but it sounds like there is more complexity here.

Have I misunderstood the memory cache behaviour? I was attempting to tune the memory cache settings for vector read performance with the assumption that any large transfer would bypass the cache (and so be unaffected by the cache settings). It sounds like I may need to rethink my strategy. Do you have recommendations or general guidance for memory proxy settings that I can go away and test?

Thanks,
Tom

> -----Original Message-----
> From: [log in to unmask] <[log in to unmask]> On
> Behalf Of Andrew Hanushevsky
> Sent: 02 July 2021 00:47
> To: Dewhurst, Alastair (STFC,RAL,SC) <[log in to unmask]>
> Cc: [log in to unmask]
> Subject: Re: Strange performance penalties when using memory proxy in front of
> Ceph
> 
> Hi Alastair,
> 
> Yes, we know that the memory caching proxy is somewhat slower than the disk
> caching proxy. That largely comes about due to the offset to memory location
> translation since the memory cache is essentially implementing a virtual address
> space architecture in software which is not cheap.
> 
> That said, the options are contradictory to the cache so it does the best it can.
> Assuming the download uses 2mb reads (does it?) and you are reading a full 1GB
> file with a cache limit of 2MB the cache is told to immediately evict the page that
> it has just read with no chance of pre-reading the next 2MB page. So, no I/O can
> be overlapped and it has to immediately reclaim the page after serving the data
> to honor the subsequent read. That will definitely slow it down and I would
> expect the transfer rate to be about 1/2 of the expected rate (which is what you
> see).
> 
> As for why this does not occur when you use a regular filesystem is likely because
> a regular filesystem will do prereads on its own and much of the loss is hidden as
> it will effectively be a memory to memory copy between the cache and the
> server.
> 
> You may want to add 'preread 1' which will preread the next page. Of course, feel
> free to use a larger value to see if it further improves things. Note that prereads
> bypass the cache limit, however the page it will not prevent early eviction of the
> page just previously read as the maximum allowed in 2MB.
> 
> Hope that makes it somewhat clearer.
> 
> Andy
> 
> On Thu, 1 Jul 2021, Alastair Dewhurst - STFC UKRI wrote:
> 
> > Hi All
> >
> > Tom Byrne and James Walder have been doing some detailed analysis of the
> performance of different XCache (in front of Ceph) at RAL[1,2].  We feel we
> understand what the disk cache is doing fairly well, however the  memory proxy
> has unexpected behaviour.  The most obvious example of this is when the
> request is for data larger than the max2cache.  In a situation like this, we believe
> the proxy should passthrough the request and we should effectively get the
> download speed without a proxy.  What we are actually observing is a throughput
> decrease of around 40%.
> >
> > The cache settings are:
> > pss.cache max2cache 2m pagesize 2m size 17g
> >
> > If we disable the cache and download a 1GB file we will get ~130MB/s
> speed from Echo.  If we enable that line that same 1GB download will go at
> ~70MB/s.  If we try the same test with a normal file system behind it, there is
> very little difference between the download speeds, with or without the memory
> cache on.
> >
> > In general the memory proxy seems to be a bit less performant than the disk
> cache.   In some use cases you would expect memory to come out on top but it
> doesn?t., although these are harder to describe.
> >
> > For the memory passthrough, is our understanding of how it works correct?  Is
> there any obvious explanation for the issue we are seeing?  Are there any
> additional settings that we should be looking at?  Any other thoughts?
> >
> > Thanks
> >
> > Alastair
> >
> >
> > [1]
> > https://indico.cern.ch/event/1052334/contributions/4422229/attachments
> > /2269798/3854559/xrootd5_wn_performance.pdf
> > [2]
> > https://indico.cern.ch/event/1052335/contributions/4422250/attachments
> > /2269537/3862394/20210630_WNXrootd5_studies.pdf
> > This email and any attachments are intended solely for the use of the named
> recipients. If you are not the intended recipient you must not use, disclose, copy
> or distribute this email or any of its attachments and should notify the sender
> immediately and delete this email from your system. UK Research and Innovation
> (UKRI) has taken every reasonable precaution to minimise risk of this email or any
> attachments containing viruses or malware but the recipient should carry out its
> own virus and malware checks before opening the attachments. UKRI does not
> accept any liability for any losses or damages which the recipient may sustain due
> to presence of any viruses. Opinions, conclusions or other information in this
> message and attachments that are not related directly to UKRI business are
> solely those of the author and do not represent the views of UKRI.
> >
> >
> >
> #################################################################
> #####
> > ##
> > Use REPLY-ALL to reply to list
> >
> > To unsubscribe from the XROOTD-L list, click the following link:
> > https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-L&A=1
> >
> 
> #################################################################
> #######
> Use REPLY-ALL to reply to list
> 
> To unsubscribe from the XROOTD-L list, click the following link:
> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-L&A=1

This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. Opinions, conclusions or other information in this message and attachments that are not related directly to UKRI business are solely those of the author and do not represent the views of UKRI.

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-L&A=1