i worked on a little tool to help me get a better understanding for my qgis-server. It mainly helped me to find the culprits of slow rendering times etc, but i continuesly added more functionallity to it like some aggregated statistic functions etc. So now it feels ready to publish it, in case some of you have a use for it.
Some Key Points:
How long does each MapRequest need on the QGIS-server
which users/projects are the most active?
did my change of hardware/serversetting bring the speed advance i hoped for?
I am using it (with a few modifications) and it is very useful.
As described, in addition to the server data, it also displays user behavior and, above all, the speed at which projects and layers are loaded.
This is very valuable for optimizing projects.
Great tool and very helpful. As a maybe too progressive guy I run my installation under Ubuntu 22.04 and it has the problem to install the python modules âpip install flask flask-socketio eventlet psutilâ. With pipx I was able to install it and âpython3 monitor.pyâ is working. But the installation of the service makes problems. I hope I can solve this problem.
Now two questions:
I use a SWAP file to prevent memory problems. Do you think I can add this to the monitor script as well?
Affect the NGINX installation a running py-qgisserver installation on the same machine?
I worked today a bit further on the tool, implementing your suggestion @tgdbepe4 to include a swap-file monitor (although I think your server should never need to fall back to it - this would probably cause a big hit on the rendering speed..).
I also added a ton of deeper insights about what users are actually doing - thanks to @wagner-it suggestions. Printing, Editing (with a small drawback: At least one field contrain needs to be configured via QGISâAttribute Form, otherwise the Editing is not sent via QGIS server and therefore will never appear in the logs), opening PopUps is now also recorded.
About your installation issues: i think you are not progressive enough - Iâm running on Ubunut 24.04 which is the latest LTR. 22.04 is outdated - which might be the cause for your pip install issue!
And on this system I have the problems with pip. How do you solved it? Or do you not have this problem?
Error when trying to install:
pip install flask flask-socketio eventlet psutil
error: externally-managed-environment
Ă This environment is externally managed
â°â> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
python3 -m venv venv # Name âvenvâ beliebig[web:3][web:5][web:9]
# 4. venv aktivieren
source venv/bin/activate # Prompt Àndert sich zu (venv)[web:3][web:5][web:9]
# 5. Innerhalb des venv Pakete installieren
pip install --upgrade pip # optional, aber sinnvoll[web:5]
pip install flask flask-socketio eventlet psutil
Solange das venv aktiv ist, bekommst du keinen externally-managed-environmentâFehler, weil pip dann in dieses isolierte Environment installiert und nicht ins SystemâPython.
Hello Peter,
I have replied to you directly by email.
We should probably stick to English here. Otherwise, should we switch to the German list?
I made the installation very easy for myself.
I gave the AI the GitHub address with @meyerlor instructions and let myself be guided (copy & paste).
It worked well right away.
Ok so no need have you solved it? pip packages should never be installed system wiede, creating a virtual environment for them is recommended. will update my installation guide!
I think itâs better that the tool remembers the last settings (for administrators and anonymous users). Thatâs how it is for me too. But Iâve also customized the tool extensively to my needs using AI.
Does the IP address really make sense? Most users probably donât have a fixed IP anyway, right?
But yes, it works. I use it for the WMS services that are used by the local QGIS.
thanks a lot @Antoviscomi, i rellay appreciate it!
Integrating it into a single lwc admin interface would certainly be possible - but the strength / scope of that tool is to monitor the underlying QGIS Server (pools). So regardless how many instances of LWC you have running on your server, everything gets aggregated into one interface. It comes more out of a debugging direction ( i had severe problems from time to time with my QGIS server across all lwc instances) and had to find a way to find culprits!
Sure @meyerlor , It is clear that it works at a low level, not at client level, and that it can be customized by including the ability to also read LWC logs, in order to have a complete picture and understand if the problematic instances are caused by the server, the client, or both.