[QGIS-Developer] QGIS server deployment

Eric Lemoine eric.lemoine at oslandia.com
Tue Feb 26 07:33:18 PST 2019


> Hi all,
> 
> I'm not a sysadmin but for our customers I'd like find the better way
> for deploy QGIS-server 3.
> 
> I try at least 3 ways:
> 
> 1) Apache2 + libapache2-mod-fcgid


There is Apache2 + mod_proxy_fcgi that you could use as well. As
opposed to mod_fcgid, mod_proxy_fcgi requires that you use your own
method for starting the FastCGI process(es) (QGIS Server here). In this
regard mod_proxy_fcgi is very similar to NGINX-based setups.


> 2) Nginx + fcgiwrap

I recently added a note to the QGIS Server docs [0] that recommends
against fcgiwrap. fcgiwrap is very slow, because it creates a new QGIS
Server process on each request!

[0]
<https://docs.qgis.org/testing/en/docs/user_manual/working_with_ogc/server/getting_started.html#nginx>

> 
> 3) Nginx + QGIS-Server working by socket/service (systemd)


I like this one a lot, because it doesn't require anything else than
systemd, which has become very very common on Linux distros. I even
wrote a blog post about it :-) See [1].

[1]
<https://oslandia.com/en/2018/11/23/deploying-qgis-server-with-systemd/>


> 
> By delveloper side, what do you think is the best?


As already said I like the systemd-only method because it doesn't
require more than systemd, which you probably already have and use on
your Linux system.

spawn-fcgi works great as well, but you will need to use something like
supervisord, or write a systemd system unit for it.


> 
> I'd like to much 3) solution, but I found some problems, in
> particular, how many sockects I've to create watching at my server?
> (Number of processors )


I'd recommend using one QGIS Server process per processor, or even a
few more for more parallelism during I/O operations. For example with 4
processors I think you can use 6-8 QGIS Server processes.


> For 1) and 2) have you experiences on performance and tuning?

Don't use 2 :-) I don't have much experience with 1 so I won't comment.
But Patrick's suggestions sound very good to me :)

One final note: at Oslandia we either use NGINX + systemd, or NGINX +
spawn-fcgi when running QGIS Server in Docker container. If you want
to use Docker I'd recommend taking a look at [2], which explains how we
build and run QGIS Server using Docker.

[2] <https://github.com/Oslandia/docker-qgis>

Good luck!

-- 
Éric Lemoine
Oslandia
+33 1 86 95 95 55
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190226/0f843813/attachment-0001.sig>


More information about the QGIS-Developer mailing list