<div dir="ltr"><div>Hi,</div><div><br></div><div>I'm sorry, I had no time to investigate further. I've just configured apache to restart mapcache every 100 requests. Poor man's garbage collection, but that works fine.<br></div><div><br></div><div>Thanks.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 15, 2019 at 10:24 PM Jeff McKenna <<a href="mailto:jmckenna@gatewaygeomatics.com">jmckenna@gatewaygeomatics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I wonder if we should tag a MapCache release today, there are over 2 <br>
years of changes committed since the last release <br>
(<a href="https://github.com/mapserver/mapcache/compare/rel-1-6-1...master" rel="noreferrer" target="_blank">https://github.com/mapserver/mapcache/compare/rel-1-6-1...master</a>).  -jeff<br>
<br>
<br>
<br>
On 2019-05-15 4:37 PM, Lime, Steve D (MNIT) wrote:<br>
> Not that I saw - nothing from Patrick beyond the original post - at <br>
> least not to the list.<br>
> <br>
> ------------------------------------------------------------------------<br>
> *From:* mapserver-dev <<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>> on behalf <br>
> of Stephen Woodbridge <<a href="mailto:stephenwoodbridge37@gmail.com" target="_blank">stephenwoodbridge37@gmail.com</a>><br>
> *Sent:* Wednesday, May 15, 2019 1:33:08 PM<br>
> *To:* <a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
> *Subject:* Re: [mapserver-dev] Memory leak in mapcache<br>
> Was there a followup on this? I don't remember seeing one.<br>
> <br>
> Thanks,<br>
>     -Steve W<br>
> <br>
> On 4/15/2019 4:36 AM, Patrick Valsecchi wrote:<br>
>> Hi Thomas, Long time no see!<br>
>><br>
>> Every kind of request leaks. Even a WMS GetCapabilities (done by the <br>
>> health-check) leaks, but at a lesser rate than a GetMap. The web UI <br>
>> does requests in //, but the ingress limits at 10 connection in //.<br>
>><br>
>> And it's not just that it allocates a big chunk of memory and stays <br>
>> there. It leaks continuously until the OOM wakes up and kills one of <br>
>> apache's worker. I had to set a limit of 100 requests (every 100 <br>
>> requests the worker process is killed and a new one is forked) per <br>
>> worker to keep memory usage at bay.<br>
>><br>
>> Thanks<br>
>><br>
>> On Fri, Apr 12, 2019 at 7:12 PM thomas bonfort <br>
>> <<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a> <mailto:<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a>>> wrote:<br>
>><br>
>>     Hi Patrick,<br>
>>     What kind of requests is mapcache responding to, and at what<br>
>>     concurrency? Serving multiple large wms requests is typically an<br>
>>     example where large chunks of memory will be allocated.<br>
>><br>
>>     --<br>
>>     thomas<br>
>><br>
>>     On Fri, Apr 12, 2019 at 12:42 AM Patrick Valsecchi<br>
>>     <<a href="mailto:patrick.valsecchi@camptocamp.com" target="_blank">patrick.valsecchi@camptocamp.com</a><br>
>>     <mailto:<a href="mailto:patrick.valsecchi@camptocamp.com" target="_blank">patrick.valsecchi@camptocamp.com</a>>> wrote:<br>
>><br>
>>         Hi,<br>
>><br>
>>         I'm using mapcache v1.6.1 (tested as well with a master build)<br>
>>         in docker and I can see huge memory increases in the apache<br>
>>         process memory usage when mapcache is used (it's the only<br>
>>         thing this apache instance is serving). The thing is<br>
>>         configured like that:<br>
>><br>
>>             <mapcache><br>
>>                <cache name="default" type="memcache"><br>
>>                   <server><br>
>>                      <host>prod-2-4-c2cgeoportal-memcached</host><br>
>>                      <port>11211</port><br>
>>                   </server><br>
>>                </cache><br>
>><br>
>>                ...<br>
>><br>
>>                <tileset name="map"><br>
>>                  <source>map</source><br>
>>                  <cache>default</cache><br>
>>                  <grid>swissgrid_005</grid><br>
>>                  <metatile>5 5</metatile><br>
>>                  <metabuffer>128</metabuffer><br>
>>                  <format>image/png</format><br>
>>                  <expires>3600</expires> <!-- 1 hour --><br>
>>                  <auto_expire>13800</auto_expire> <!-- 4 hours --><br>
>>               </tileset><br>
>><br>
>><br>
>>         I can see that memcached is used in it's stats and only<br>
>>         mapcache uses it.<br>
>><br>
>>         But the the memory usage of the whole mapcache container looks<br>
>>         like that:<br>
>>         image.png<br>
>><br>
>>         Each dip in usage is when the OOM kills one of the apache<br>
>>         workers (out of a maximum of 3 workers). I have configured a<br>
>>         memory limit in docker at 512MB.<br>
>>         Nothing shows up in the apache logs.<br>
>><br>
>>         Are there any known memory leaks? Do I have a bad<br>
>>         configuration? I could have the apache workers restarted every<br>
>>         10 queries, but that would be utterly ugly and inefficient...<br>
>><br>
>>         Thanks for your help.<br>
><br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a></blockquote></div>