I'm currently exploring QGIS-server 3.2.3 and QWC2.
Currently, I'm experiencing some issues with my postgres based vector layers, so I seek hints or pointers to my questions:
- PostgreSQL Connection pooling: Accessing the server via one QWC2 session I got nearly 100 postgres session. How is connection pooling working within QGIS-server? How many open connections is QGIS-server using and is this configurable?
- Tracing the database, I see that
SELECT count(*) FROM "mytable"is issued very often. This might be an alive-check query for pooled connections(?) As this is a costly query on my large tables: where does it come from and is it configurable?
- The inital GetCapabilities request takes very long, again because my tables contain millions of records and for every layer a
SELECT ST_Extent("wkb_geometry") FROM "mytable" AS ogrpgextentis issued. I wonder, why
st_extentis requested and not
st_estimated_extent, as the table is analyzed and
SELECT count(*) FROM pg_stats WHERE schemaname='public' AND tablename='mytable' AND attname='wkb_geometry';returns 1. And where does "ogrpgextent" come from, as my layers are defined with providerKey 'postgres' and not 'ogr'? It seems to me, that the database is not accessed via qgspostgresprovider but ogr(?)
- How can I enable verbose logging? I set
FcgidInitialEnv QGIS_DEBUG 1, FcgidInitialEnv QGIS_SERVER_LOG_FILE /tmp/qgis-000.log, FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0but I don't see any log QgsDebugMsg-statements which I'd expect to see...
- The docs state that QGIS has to be compiled with Postgres support. What does it take to compile QGIS with Postgres support? How can I figure out, if docker image qgis/qgis:final-3.2.3 is compiled with Postgres support? Docker container build-deps contains postgres-client , but unlike other databases the cmake call in the dockerfile does not include a flag like WITH_POSTGRES which I'd expect (in analogy to e.g. WITH_QSPATIALITE)?
The layers in the .qgs file are defined like this:
<layer-tree-layer expanded="0" id="mytable_20180912153643064" source="dbname='mypassword' host=192.168.33.10 port=5432 user='myuser' sslmode=disable key='objectid' srid=31467 type=MultiLineString table="public"."mytable" (wkb_geometry) sql=" checked="Qt::Checked" name="mytable" providerKey="postgres">...</layer-tree-layer>