WebFaction
Community site: login faq

I am using GeoDjango and I am trying to understand how to deploy it:

Warning

GeoDjango uses the GDAL geospatial library which is not thread safe at this time. Thus, it is highly recommended to not use threading when deploying – in other words, use an appropriate configuration of Apache.

For example, when configuring your application with mod_wsgi, set the WSGIDaemonProcess attribute threads to 1, unless Apache may crash when running your GeoDjango application. Increase the number of processes instead.

  • If the apache configuration is using a threaded mpm-worker, will threads=1 guarantee thread safety?

  • What would be a basic setup for apache to cope with wsgi processes=5 and threads=1?

This is my current, memory consuming, mpm-prefork setup:

KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
StartServers 5
MinSpareServers 5
MaxRequestsPerChild 0
MaxClients 20

WSGIDaemonProcess <user> processes=5 threads=1 python-home=/path/to display-name='wsgi-daemon-process'

WSGIProcessGroup <user>
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIApplicationGroup %{GLOBAL}

This the mpm-worker setup:

KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5

WSGIDaemonProcess <user> processes=5 threads=1 python-path=/path/to

WSGIProcessGroup <user>
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIApplicationGroup %{GLOBAL}

asked 16 Mar, 18:52

raratiru's gravatar image

raratiru
416
accept rate: 0%

edited 16 Mar, 18:53


I should also mention, you may want to ask the question with some test results. You can use the 'ab' tool to generate requests to your application. You may want to write some test views which call the geo libs you wish and do some basic query sets with them and use 'ab' to generate false load. By doing this you can answer the question by testing.

permanent link

answered 16 Mar, 23:29

johns's gravatar image

johns ♦♦
5.1k211
accept rate: 22%

You should pose these questions to the mod_Wsgi or GeoDjango developers or just try and see what happens. I would have to test it to see what happens and can't answer your question without a live deployment to do that with.

permanent link

answered 16 Mar, 21:32

johns's gravatar image

johns ♦♦
5.1k211
accept rate: 22%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×53
×6
×5

question asked: 16 Mar, 18:52

question was seen: 141 times

last updated: 16 Mar, 23:29

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM