[mapserver-users] Mapcache time dimension default value; and 'tearing down pooled connection' message
Trygve Aspenes
trygve at aspenes.priv.no
Mon Jan 17 09:59:25 PST 2022
Hi there!
Slowly I'm getting mapserver/mapcache up running and looks now how to
improve things.
First: When I load a mapcache tileset with time dimension from a pg db
the oldest image is displayed in my client. Is it possible to somehow
get the newest image as default?
My tileset dimension look something like this:
<dimension type="postgresql" name="time" default="d1"
time="true" unit="ISO8601">
<connection>
host=mapserver-db user=$PGSQ_USERNAME
password=$PGSQ_PASSWORD dbname=mapserver port=5432
</connection>
<list_query>SELECT to_char(time,
'YYYY-MM-DD"T"HH24:MI:SS"Z"') FROM products where product_name='<some
product>' order by Id</list_query>
<validate_query>
SELECT to_char(time,'YYYY-MM-DD"T"HH24:MI:SS"Z"')
FROM products
WHERE time >= to_timestamp(:start_timestamp)
AND time <= to_timestamp(:end_timestamp)
AND product_name='<some product>'
ORDER BY time DESC
</validate_query>
</dimension>
I saw the `d1` default value in the documentation, but don't understand
of that is a dummy or an actual selector. I have grepped around the
source code, but could not see anything obvious.
Second: My client updates/fetch the getCapabilities of my mapcache
server every minute. Each time this is fetched the mapcache log is
filled with messages like:
mod_mapcache.c(164): [client ] tearing down pooled connection (dim_<some
product>_time) to make room, referer: <my client>
I dont understand why these connections is teared down every time
getCapabilites is requested.
I have looked in the documentation, but could not see how to control
this. But in the mapcache.xml.sample the connection pool config is
described. But adding this to my mapcache config does not remove these
tear downs.
<connection_pool>
<max_connections>2000</max_connections>
<time_to_live_us>120000000</time_to_live_us>
</connection_pool>
Any suggestions why this connection tear down is happening and if there
is something to do about it. It slows down the getCapabilities request a
bit, but if I add to many tileset I guess this will even further slow
down.
Thanks
Trygve Aspenes
More information about the MapServer-users
mailing list