AW: Debian 13 - Apache - FCGI - cgi-mapserver
Sebastiaan Couwenberg
sebastic at xs4all.nl
Tue Dec 16 15:26:02 GMT 2025
On 12/16/25 3:43 PM, Neubauer, Steffen (VermKV) wrote:
> Here are a few more details. The data source consists mostly of aerial images (compressed 100 GB for one Layer). I used map2img to compare the response time between Debian 12 - MapServer 8.0.0 and Debian 13 - MapServer 8.4.0 The response time was ~ identical. The raster data is embedded in the map file using a gdaltindex. This took about 200ms for both systems with default map2img BBOX. The database response time for the metadata layer was about 20ms. However, when the system is running in production with Apache as an FCGI process, the MapServer processes consume more and more RAM up to 2GB / normal was 300MB (MapServer 8.0). An FCGI process runs for 60 minutes by default. I then reduced this to 10 minutes so that the process would terminate before too many processes consumed the available memory. This means that FCGI caching isn't working optimally, so the average response time in Apache status isn't settling at around 225 ms (Fig. 1), but rather at over 400 ms. Under Debian 12, the FCGI MapServer processes didn't consume RAM to this extent.
>
> [...]
>
> In my opinion, the problem isn't with PostgreSQL/PostGIS. Furthermore, I installed MapServer 8.6 from the backports repository and encountered the same behavior. Perhaps the issue lies with the MapServer or Apache-FCGI or GDAL-Version?
Likely the interaction between apache2 and fastcgi.
With mod_fcgid not having a release since 2013 I doubt you'll get any fixes for it.
Googling for "apache fcgi memory leaks" shows many people implementing process managers kill the offending processes.
That seems like a poor band-aid.
I guess most people simply throw more hardware resources at the problem because it's too time consuming to troubleshoot.
It would be interesting to see how your mapserver setup performs and behaves with nginx and its ngx_http_fastcgi_module.
Hopefully you have a test environment where you can perform experiments like this without affecting your production environment.
Kind Regards,
Bas
--
PGP Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
More information about the Pkg-grass-devel
mailing list