[mapserver-users] MapCache: Memory leak in WMTSCapabilities request?

2021-04-13 Thread Schmid Andreas
Hi

I'm running MapCache 1.10.0 in a Docker container. The image is based on 
debian:bullseye; Apache and MapCache is installed into the image with apt. 
Everything works fine; however when I set the health checks to regularly 
request the WMTS Capabilities at mapcache/wmts/1.0.0/WMTSCapabilities.xml, the 
memory usage of the container increases continuously. In a test setup with 12 
of these requests per minute and no other requests, the increase is around 25MB 
per day.
When I set the health checks to simply request a certain tile, there is no such 
increase of memory usage.

Does this mean there is a memory leak in the WMTSCapabilities functionality? 
Something similar has been described in 
http://osgeo-org.1560.x6.nabble.com/Memory-leak-in-mapcache-td5401587.html two 
years ago, but no real solution has been found there.


Best regards,
Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Parametrizing a MapCache config file

2020-12-18 Thread Schmid Andreas
Thank you, Dave, for sharing your solution. So as the differences between my 
config files are small, I guess I'm going to solve it with a sed script that 
reads the actual values from environment variables. And the templating language 
approach for sure would be the way to go for more complex cases.

I'm actually using this in a MapCache Docker image too, that should include the 
config file for convenience.

Best regards,
Andy


> -Ursprüngliche Nachricht-
> Von: mapserver-users  Im Auftrag
> von David Hoese
> Gesendet: Donnerstag, 17. Dezember 2020 16:48
> An: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Parametrizing a MapCache config file
> 
> Hi,
> 
> I had a similar need where I was running MapCache in a docker container
> and needed the config to change based on some user-provided environment
> variables. I ended up writing a python script that uses the Jinja
> templating language. That way I could write a really complex config
> "template" and run my python script when the docker container started and
> produce the desired output config. It was extra nice for me because my
> jinja template allowed me to do "for" loops and in my case I had a lot of
> the same grids and tilesets that were only different by one or two
> parameters.
> 
> It would be nice if there was something builtin, but I think a sed script
> or something like my Jinja templating are the easiest solutions.
> 
> Dave
> 
> Example
> ---
> 
>  
>  
>  
>  
>  rgba
>  bw_map
>  
>  
>  
>  http://{{ wms_host }}:{{ wms_port }}/wms/borders
>  10
>  15
>  
>  
> 
> Python (trimmed down)
> -
> 
>  tmpl_vars = {'wms_host': 'my_host', 'wms_port': , 'plat':
> 'test', 'inst': 'example'}
>  with open(args.template_fn, 'r') as tmpl_file:
>  template = jinja2.Template(tmpl_file.read())
>  print(template.render(tmpl_vars))
> 
> I then run it like:
> 
> python render.py > /path/to/output_config.xml
> 
> On 12/17/20 7:26 AM, Schmid Andreas wrote:
> > Hi list
> >
> > I'm looking for a way how I could parametrize a MapCache XML config
> file. Up to now, I have three config files: One that I use for development
> purposes, one for running MapCache in the test environment, and one for
> the production environment. The files differ only in the URL of the
> service metadata, the URL of the http-source, and whether the demo service
> is enabled. So when I change something in the file, I always need to make
> sure that I make the same change in the other files. Which I don't really
> like because it's error-prone.
> >
> > One solution that I can think of is keeping only one file and putting
> placeholders in the appropriate places. And then running a sed-Script over
> it before deploying it.
> >
> > But maybe someone knows of a smarter idea for this?
> >
> > Thanks a lot,
> > Andy
> >
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Parametrizing a MapCache config file

2020-12-17 Thread Schmid Andreas
Hi list

I'm looking for a way how I could parametrize a MapCache XML config file. Up to 
now, I have three config files: One that I use for development purposes, one 
for running MapCache in the test environment, and one for the production 
environment. The files differ only in the URL of the service metadata, the URL 
of the http-source, and whether the demo service is enabled. So when I change 
something in the file, I always need to make sure that I make the same change 
in the other files. Which I don't really like because it's error-prone.

One solution that I can think of is keeping only one file and putting 
placeholders in the appropriate places. And then running a sed-Script over it 
before deploying it.

But maybe someone knows of a smarter idea for this?

Thanks a lot,
Andy

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users