On Apr 24, 12:57 am, Rufman <[EMAIL PROTECTED]> wrote: > Hey > > I was wondering: Is Django faster and stabler using mod_python or > fcgi? > > I read that mod_python can be a memory hog...what are the concrete > advantages of using fcgi or mod_python for that matter?
That mod_python can be a memory hog is a bit of a myth. Yes it does have a base level memory consumption which is a bit more than necessary, but complaints about mod_python being really fat actually stem mostly from having a Python installation that didn't provide a shared library for Python. Lack of a shared library results in Python static library being incorporated in mod_python Apache module. When that was then loaded, because address relocations had to be performed, it became process local memory, thus adding a few MB to size of process. If shared library for Python is correctly used, this doesn't occur. As a result, the per process memory requirements of mod_python and fastcgi aren't that much different when looked at in the greater scheme of things, in as much as your actual Django application is chewing up 40-60MB of memory where as mod_python and fastcgi will be a lot less than that. In other words, be more worried about how much memory your Django application is chewing up rather than the hosting mechanism. That all said, mod_wsgi is possibly a better choice than both. This is because in its mode where it works like mod_python it has less base level memory overhead than mod_python. On top of that it also supports a mode which gives similar properties to fastcgi. Thus mod_wsgi can do what both of these other systems do in the one package. The mod_wsgi package also has less performance overheads, although like with memory, the real bottleneck is your Django application, plus any database accesses. Other things you need to consider are whether you use Apache prefork or worker MPM. With prefork you will have a lot more instances of your fat Django application, thus overall memory usage is more. You should therefore look at whether your application is multithread safe and use worker MPM instead, or use mod_wsgi daemon mode with a single or small number of multithread processes. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---