Opened 10 years ago

Closed 8 years ago

#1383 closed defect (fixed)

qgis_server demo brings the OSGeo Live VM down

Reported by: rouault Owned by: live-demo@…
Priority: normal Milestone: OSGeoLive8.0
Component: OSGeoLive Keywords: qgis_server
Cc: live-demo@…

Description

When having launched Firefox and then the QGIS_MapServer demo, panning works. But once you zoom in, blank map or partly blank with partly valid areas. But more annoying, when zooming in and out a lot, I have had a VM hang. A huge number of qgis_mapserver processes are forked. A top showed the load to go up to 50. This is actually quite easily reproducable (each time I tried that demo, so 3 times).

Change History (12)

comment:1 by kalxas, 10 years ago

Cc: live-demo@… added
Milestone: OSGeoLive8.0
Type: taskdefect

Hi Even,

Thanks for testing. Can you please provide the amount of RAM you use in the VM?

comment:2 by rouault, 10 years ago

RAM for the VM: 1GB

comment:3 by rouault, 10 years ago

But the main issue must be more on the client side of the demo that launches too much requests without waiting the previous ones from being completed. Or on the Apache config that should limit the number of requests.

comment:4 by hamish, 10 years ago

can anyone on the qgis team help?

comment:5 by hamish, 10 years ago

Keywords: 8.0 removed

I can reproduce, qgis_mapserv processes deadlock the VM for a while if you zoom in and out too much.

comment:6 by larrysh, 10 years ago

Hi,

I don't see where mod_fcgid is configured for QGIS Server. The default for libapache2-mod-fcgid (assuming it is the basic Ubuntu package) is:

/etc/apache2/mods-available/fcgid.conf

<IfModule mod_fcgid.c>
  FcgidConnectTimeout 20

  <IfModule mod_mime.c>
    AddHandler fcgid-script .fcgi
  </IfModule>
</IfModule>

Probably would want something like:

<IfModule mod_fcgid.c>
  FcgidConnectTimeout 20

  FcgidCmdOptions /usr/lib/cgi-bin/qgis_mapserv \
    ConnectTimeout 5 \
    IdleTimeout 300 \
    IOTimeout 40 \
    MaxProcesses 20 \
    MaxProcessLifeTime 3600 \
    MaxRequestsPerProcess 0 \
    MinProcesses 3

  <IfModule mod_mime.c>
    AddHandler fcgid-script .fcgi
  </IfModule>
</IfModule>

Just guessing on the appropriate config here. See: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidcmdoptions for details.

Probably best to not edit that file, but set the options in the default site config or make a specific config that's included. Then, add the setup to install_qgis_mapserver.sh. All of this is completely untested by me (just pulled an older config I had used in the past out of an old server backup).

It is also possible to configure QGIS Server to run under lighttpd instead. This may be a lightweight alternative to Apache, if the issue can not be resolved (though no guarantee that moving to lighttpd will work around the issue).

comment:7 by pka, 10 years ago

Limiting the FCGI processes to 2-4 should solve the system overload. Replacing the very old GeoExt ad-hoc viewer with QGIS Web-Client or something else would probably solve the problem as well. But I won't find the time for implementing either of that.

in reply to:  6 comment:8 by hamish, 10 years ago

Replying to larrysh:

It is also possible to configure QGIS Server to run under lighttpd instead. This may be a lightweight alternative to Apache, if the issue can not be resolved (though no guarantee that moving to lighttpd will work around the issue).

Full apache2 is already installed on the disc for other projects and purposes, so a custom site config would be best I think, rather than adding another server, even if it is "light". See the latest nightly iso builds (then trace back to install scripts for them) for how other projects are adding and ring-fencing theirs.

thanks, Hamish

comment:9 by larrysh, 10 years ago

Should be fixed with changeset:11927 Will issue reporter please verify?

However, the use of Apache with mod_fcgid is not an ideal setup for qgis_mapserv.fcgi. It runs much better under mod_fastcgi, but that can not be installed alongside of mod_fcgid at the same time.

Also, I test with lighttpd, as is used for the labeling unit tests in QGIS source, and the demo is lightning fast, with very little resources used when compared to Apache. I feel this is a more appropriate means of demoing the QGIS Server, especially if the web client is upgraded to use QGIS Web Client (which it should be).

comment:10 by pka, 10 years ago

Thanks Larry for setting up FCGI! This should solve the issue reported by Even. It reminds me why I've installed QGIS server in CGI mode. It was to make the quickstart easier, because no restart is needed after a project update. In the meantime this should also work in FCGI mode.

Regarding Apache/lighttpd: Since Apache is already running, I wouldn't expect a performance improvement with lighttpd on OSGeo Live. Side note: On QGISCloud we're quite happy with Nginx as an Apache replacement. And for testing we run QGIS Server _without_ a web server, passing parameters as environment variables.

comment:11 by hamish, 10 years ago

tested ok in nightly-build11938. it's not lighting fast, but it works and doesn't take down the system any more. :-)

the quickstart was a bit broken & out of date. I've updated that now in svn.

the .qgs example files in ~/qgis-examples/ should be refreshed for version 2.4, you get the "migrate old project version" banner when you open them.

Hamish

comment:12 by kalxas, 8 years ago

Resolution: fixed
Status: newclosed

Seems fixed.

Note: See TracTickets for help on using tickets.