<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" >Does your internally developed application do&nbsp;only reads during in its monthly run? &nbsp; If so, can you change it to use PROT_READ&nbsp;flag during the mmap call? &nbsp;That way you will not get the 10-block decompression IO overhead and your files will remain compressed. &nbsp;The decompression happens upon pagein's only if the mmap call includes the PROT_WRITE flag (or upon actual writes for non-mmap IOs).</div>
<div dir="ltr" >&nbsp;</div>
<div dir="ltr" >Leo</div>
<div dir="ltr" >&nbsp;</div>
<blockquote data-history-content-modified="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Zachary Giles &lt;zgiles@gmail.com&gt;<br>Sent by: gpfsug-discuss-bounces@spectrumscale.org<br>To: gpfsug main discussion list &lt;gpfsug-discuss@spectrumscale.org&gt;<br>Cc:<br>Subject: Re: [gpfsug-discuss] Questions about mmap GPFS and compression<br>Date: Tue, Feb 14, 2017 8:10 AM<br>&nbsp;
<div><font face="Default Monospace,Courier New,Courier,monospace" size="2" >Hi Leo,<br><br>I agree with your view on compression and what it should be used for,<br>in general. The read bandwidth amplification is definitely something<br>we're seeing.<br><br>Just a little more background on the files:<br>The files themselves are not "cold" (archive), however, they are very<br>lightly used. The data set is thousands of files that are each<br>100-200GB, totaling about a PB. the read pattern is a few GB from<br>about 20% of the files once a month. So the total read is only several<br>TB out of a PB every month. ( approximate ). We can get a compression<br>of about 5:1 using GPFS with these files, so we can gain back 800TB<br>with compression. The total run time of the app (reading all those all<br>chunks, when uncompressed) is maybe an hour total.<br><br>Although leaving the files uncompressed would let the app work,<br>there's a huge gain to be had if we can make compression work by<br>saving ~800TB As it's such a small amount of data read each time, and<br>also not too predictable (it's semi-random historical), and as the<br>length of the job is short enough, it's hard to justify decompressing<br>large chunks of the system to run 1 job. I would have to decompress<br>200TB to read 10TB, recompress them, and decompress a different<br>(overlapping) 200TB next month. The compression / decompression of<br>sizable portions of the data takes days.<br><br>I think there maybe more of an issue that just performance though..<br>The decompression thread is running, internal file metadata is read<br>fine, most of the file is read fine. Just at times it gets stuck.. the<br>decompression thread is running in GPFS, the app is polling, it just<br>never comes back with the block. &nbsp;I feel like there's a race condition<br>here where a block is read, available for the app, but thrown away<br>before the app can read it, only to be decompressed again.<br>It's strange how some block positions are slow (expected) and others<br>just never come back (it will poll for days on a certain address).<br>However, reading the file in-order is fine.<br><br>Is this a block caching issue? Can we tune up the amount of blocks kept?<br>I think with mmap the blocks are not kept in page pool, correct?<br><br>-Zach<br><br>On Sat, Feb 11, 2017 at 5:23 PM, Leo Luan &lt;leoluan@us.ibm.com&gt; wrote:<br>&gt; Hi Zachary,<br>&gt;<br>&gt; When a compressed file is mmapped, each 4K read in your tests causes the<br>&gt; accessed part of the file to be decompressed (in the granularity of 10 GPFS<br>&gt; blocks). &nbsp;For usual file sizes, the parts being accessed will be<br>&gt; decompressed and IOs speed will be normal except for the first 4K IO in each<br>&gt; 10-GPFS-block group. &nbsp;For very large files, a large percentage of small<br>&gt; random IOs may keep getting amplified to 10-block decompression IO for a<br>&gt; long time. &nbsp;This is probably what happened in your mmap application run.<br>&gt;<br>&gt; The suggestion is to not compress files until they have become cold (not<br>&gt; likely to be accessed any time soon) and avoid compressing very large files<br>&gt; that may be accessed through mmap later. &nbsp;The product already has a built-in<br>&gt; protection preventing compression of files that are mmapped at compression<br>&gt; time. &nbsp;You can add an exclude rule in the compression policy run for files<br>&gt; that are identified to have mmap performance issues (in case they get<br>&gt; mmapped after being compressed in a periodical policy run).<br>&gt;<br>&gt; Leo Luan<br>&gt;<br>&gt; From: Zachary Giles &lt;zgiles@gmail.com&gt;<br>&gt; To: gpfsug main discussion list &lt;gpfsug-discuss@spectrumscale.org&gt;<br>&gt; Date: 02/10/2017 01:57 PM<br>&gt; Subject: [gpfsug-discuss] Questions about mmap GPFS and compression<br>&gt; Sent by: gpfsug-discuss-bounces@spectrumscale.org<br>&gt; ________________________________<br>&gt;<br>&gt;<br>&gt;<br>&gt; Hello All,<br>&gt;<br>&gt; I've been seeing some less than desirable behavior with mmap and<br>&gt; compression in GPFS. Curious if others see similar or have any ideas<br>&gt; if this is accurate..<br>&gt; The guys here want me to open an IBM ticket, but I figured I'd see if<br>&gt; anyone has had this experience before.<br>&gt;<br>&gt; We have an internally developed app that runs on our cluster<br>&gt; referencing data sitting in GPFS. It is using mmap to access the files<br>&gt; due to a library we're using that requires it.<br>&gt;<br>&gt; If we run the app against some data on GPFS, it performs well..<br>&gt; finishing in a few minutes time -- Great. However, if we compress the<br>&gt; file (in GPFS), the app is still running after 2 days time.<br>&gt; stracing the app shows that is polling on a file descriptor, forever..<br>&gt; as if a data block is still pending.<br>&gt;<br>&gt; I know mmap is supported with compression according to the manual<br>&gt; (with some stipulations), and that performance is expected to be much<br>&gt; less since it's more large-block oriented due to decompressed in<br>&gt; groups.. no problem. But it seems like some data should get returned.<br>&gt;<br>&gt; I'm surprised to find that a very small amount of data is sitting in<br>&gt; the buffers (mmfsadm dump buffers) in reference to the inodes. The<br>&gt; decompression thread is running continuously, while the app is still<br>&gt; polling for data from memory and sleeping, retrying, sleeping, repeat.<br>&gt;<br>&gt; What I believe is happening is that the 4k pages are being pulled out<br>&gt; of large decompression groups from an mmap read request, put in the<br>&gt; buffer, then the compression group data is thrown away since it has<br>&gt; the result it wants, only to need another piece of data that would<br>&gt; have been in that group slightly later, which is recalled, put in the<br>&gt; buffer.. etc. Thus an infinite slowdown. Perhaps also the data is<br>&gt; expiring out of the buffer before the app has a chance to read it. I<br>&gt; can't tell. &nbsp;In any case, the app makes zero progress.<br>&gt;<br>&gt; I tried without our app, using fio.. mmap on an uncompressed file with<br>&gt; 1 thread 1 iodepth, random read, 4k blocks, yields ~76MB/s (not<br>&gt; impressive). However, on a compressed file it is only 20KB/s max. (<br>&gt; far less impressive ). Reading a file using aio etc is over 3GB/s on a<br>&gt; single thread without even trying.<br>&gt;<br>&gt; What do you think?<br>&gt; Anyone see anything like this? Perhaps there are some tunings to waste<br>&gt; a bit more memory on cached blocks rather than make decompression<br>&gt; recycle?<br>&gt;<br>&gt; I've searched back the archives a bit. There's a May 2013 thread about<br>&gt; slowness as well. I think we're seeing much much less than that. Our<br>&gt; page pools are of decent size. Its not just slowness, it's as if the<br>&gt; app never gets a block back at all. ( We could handle slowness .. )<br>&gt;<br>&gt; Thanks. Open to ideas..<br>&gt;<br>&gt; -Zach Giles<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; gpfsug-discuss mailing list<br>&gt; gpfsug-discuss at spectrumscale.org<br>&gt; <a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss" target="_blank" >http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a><br>&gt;<br><br><br><br>--<br>Zach Giles<br>zgiles@gmail.com<br>_______________________________________________<br>gpfsug-discuss mailing list<br>gpfsug-discuss at spectrumscale.org<br><a href="http://gpfsug.org/mailman/listinfo/gpfsug-discuss" target="_blank" >http://gpfsug.org/mailman/listinfo/gpfsug-discuss</a></font><br>&nbsp;</div></blockquote>
<div dir="ltr" >&nbsp;</div></div><BR>