-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS Server performance questions #10
Comments
It is known that the first time a project has to be loaded in qgis server it may takes some outrageous amount of time depending on the number of layers and the datasource involved. Now you must know that py-qgis-server use qgis server worker in child processes for handling requests (qgis server by itself is not asynchronous and that there is no shared cache between those workers (an issue that cannot be solved without rewriting a large part of Qgis code). From this you may experience latency each time a project has to be loaded in a worker cache and Depending of the nature and the number of projects (number of layers, big datasources....) you are using you may have to use different proxy strategies (for exemple you may implement sharding with several py-qgis-server instances). If you have a few projects, you may also considering seeding with multiple initial requests until all workers have their projects loaded. |
Interesting. How to implement sharding with several py qgis servers? |
You pop several instances of py-qgis-servers and may use a nginx as reverse proxy with some consistent hashing of the MAP parameter. |
I noticed that there is QGSRV_CACHE_ROOTDIR variable. May it help? |
No, the cache QGSRV_CACHE_ROOTDIR set the location of the projects files. The configuration is not well documented and we are working on it. You may adjust the number of workers with QGSRV_SERVER_WORKERS. |
Interesting discussion ! |
It is not thread, it is really multi processing. Requests are distributed using a fair queuing with 0MQ messaging. you may also distribute your workers on a whole cluster by running worker only/proxy only containers. |
Ok understand, thank you. So it means, it will need a big infrastructure to achieve good performances but when I tried with lizmap-docker-compose on big project and 8 vcpu + 8 gb ram, it never reach full computer load (ram and cpu : ram does not reach his maximum and cpu stay at around 25% by vCPU). Even with agressive parameters in :
So at this time, my question is : any idea where this limitation come from :
|
You will saturate your CPU with computation intensive jobs. This is highly dependend of the context and the kind of project, as a rule a thumb you may expect that jobs spend most of the doing I/0 which means it has mostly no impact on cpu demand. Increasing the number of workers will not change loading time nor the time spent internally by one worker to process your request: it will enable you to process more request at the same time scale according to your request rate. Because of this you must also set the proper values for php-fpm depending on what is your scenario. A said before, performances depends on many factors and the appropriate solution depends on what you want to improve. AMHA, here are the questions to asks: Number of workers, php configuration and cache size will play a role with:
And the following will impact the internal performances of each workers
The former questions target your infrastructure choice, the latter rely for the most part on Qgis internal performances. |
Ok thank you for the reply, with docker stats I clearly show the I/0.
to
Tested on Lizmap and show an improvement on pre cached layers |
Good to know thanks ! |
Do you have some metrics ? Could be interesting to investigate the performance gain. |
No sorry, just visual but you could read here some input about I/0 on docker with metrics : moby/moby#21485 So you could test by yourself with reading / writing inside and outside your container. PR at the end moby/moby#24307 |
Il giorno mar 7 lug 2020 alle ore 13:26 Sylvain POULAIN <
notifications@github.com> ha scritto:
Consider looking at TasksMax=infinity as well in same systemd service as
it was not mention in PR and related to your kernel option
Where can I try this setting (among the other as LimitNOFILE and
LimitNPROC)?
…--
Comune di Trento
via Belenzani, 19 - 38122 Trento | C.F e P. IVA:
00355870221
tel. +39 0461.884111 | www.comune.trento.it
<http://www.comune.trento.it>
|
Depending on your host linux distribution. Some distribution already have it well tuned. Could not be a final solution and need to be more tested with qgis server |
I see a new config "SERVER_RESTARTMON", can we use it to improve internal performances of each workers ? By updating the file that "SERVER_RESTARTMON" is watching before a user make an OWS request. Is there a way to make have timeout before request send a '422 Unprocessable Entity' ? Thanks for your work ! |
@TANK2003 SERVER_RESTARTMON is a just a very simple way to ask the workers to make a graceful restart, for example when you are updating plugins, it is not really related to internal performances. '422 Unprocessable Entity' has nothing to do with timeout, it is sent when you have invalid layers in strict checking mode. |
Hello,
I'm doing a WFS querying on your qgis docker: https://hub.docker.com/r/3liz/qgis-map-server/
I noticed that there some performance issues on WFS querying.
First time it takes 5 seconds to identify a point, then the second time is instantaneously. But the third time, after some time (45 seconds), it takes 5 seconds again.
Logs of first REQUEST: 10:16:32 -> 10:16:37
SECOND request: the response is instant
THIRD request after 30-45 seconds: 10:19:26 -> 10:19:31, again 5 seconds
The text was updated successfully, but these errors were encountered: