3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
68 stars 16 forks source link

Pro & Cons of py-qgis-server #26

Closed arno974 closed 3 years ago

arno974 commented 3 years ago

Hi,

What are the advantages and disadvantages of using py-qgis-server rather than other alternatives like apache or nginx? The benefits are not quite clear for me.

Thanks.

dmarteau commented 3 years ago

py-qgis-server rather than other alternatives like apache or nginx

py-qgis-server is not an alternative to apache or nginx, it is an embedded version of qgis server, it is an alternative to the default provider fcgi wrapper.

The differences are quoted here: https://github.com/3liz/py-qgis-server#features

Gustry commented 3 years ago

The differences are quoted here: https://github.com/3liz/py-qgis-server#features

Some items are supported natively like project stored in PG, WFS3. Maybe we should make it explicit what are the pros compare to the "normal qgis server" ?

dmarteau commented 3 years ago

Maybe we should make it explicit what are the pros compare to the "normal qgis server" ?

It seems to me that the description is self-explanatory

The server may be run as a self-contained single service or as a proxy server with an arbitrary number of 
workers running remotely or locally. Independant workers connect automatically to the front-end proxy with no need 
of special configuration on the proxy side. Thus, this is ideal for auto-scaling configuration for use with container orchestrator
as Rancher, Swarm or Kubernetes.

The server is aimed at solving some real situations encountered in production environment: zero conf scalability, handle 
long-running request situation, auto restart...

Py-qgis-server was created as response to the needs mentionned above.

arno974 commented 3 years ago

Thanks @dmarteau, I was thinking that py-qgis-server was related to an http server. I will try it !

dmarteau commented 3 years ago

I was thinking that py-qgis-server was related to an http server.

It is an http server (tornado-based) not an fcgi/wsgi module ! It still perfectly usable behind any reverse proxy.

dmarteau commented 3 years ago

To be precise:

py-qgis-server has been written to have a error recovery mecanism that prevent the server to be stuck in long running/stalled requests (Qgis server may have hard time with some bad requestes or bad configured database dataset).

This require separation of processes and asynchronous handling/dispatching requests/responses front end with some supervisor master processes that enables hot restart of stuck processes. This is not doable easily in a fcgi/wsgi design that in facts gives your little controls of your workflow, and this is why it is implemented as an http server.

In all case, it is always a good practice to run your services behind a reverse proxy ( nginx, apache.... whatever)