On May 27, 4:54 pm, Ben Welsh <ben.we...@gmail.com> wrote:
> The nabble link I provided has a lot of that stuff. The answers are prefork,
> mod_python and the following. If you would recommend a switch to mod_wsgi,
> could you please recommend the best guides for how and why? I'm always
> interested in reading more on this topic that I can educate myself on the
> options. Thank you again.

For some reasons as to why, read:

  http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

The documentation for mod_wsgi and how to use Django with it can be
found at mod_wsgi site.

  http://www.modwsgi.org

Start by working through the quick configuration guide to get an
understanding of the basics and get hello world examples going. Then
consider trying Django.

Graham

>
> $ httpd -l
> Compiled in modules:
>   core.c
>   prefork.c
>   http_core.c
>   mod_so.c
>
> httpd.conf...
> Timeout 20
> KeepAlive Off
> MaxKeepAliveRequests 100
> KeepAliveTimeout 5
>
> <IfModule prefork.c>
> StartServers       2
> MinSpareServers    2
> MaxSpareServers    5
> ServerLimit      200
> MaxClients       200
> MaxRequestsPerChild  4000
> </IfModule>
>
> On Tue, May 26, 2009 at 11:44 PM, Graham Dumpleton <
>
> graham.dumple...@gmail.com> wrote:
>
> > On May 27, 4:17 pm, Ben Welsh <ben.we...@gmail.com> wrote:
> > > Thanks for your advice. It's much appreciated.
>
> > > I've been encountering "too many file open" errors through Apache. I have
> > a
> > > thread open on httpd-users discussing the topic.
>
> > >http://www.nabble.com/-users%40httpd--What-is-the-best-way-to-handle-...
>
> > > To date, the steps I've taken have been:
>
> > > 1) Trimming a number of needless Apache modules, in hopes, perhaps vain,
> > of
> > > reducing the `lsof | grep httpd` count.
> > > 2) Adding RAM to my existing production server
> > > 3) Expanding my production rig to include a new dedicated database
> > server,
> > > which relieves the postgresql responsibilities from my first machine
>
> > > That's where I'm at.
>
> > But which Apache MPM are you using and are you using mod_python or
> > mod_wsgi? If mod_wsgi are you using embedded mode or daemon mode? Are
> > you hosting static files on the same web server? Are you running PHP
> > crap on the same server inside of Apache? And finally, have you
> > fiddled with the default KeepAlive/Timeout Apache directives?
>
> > Graham
>
> > > On Tue, May 26, 2009 at 11:10 PM, Graham Dumpleton <
>
> > > graham.dumple...@gmail.com> wrote:
>
> > > > On May 27, 2:33 pm, Ben Welsh <ben.we...@gmail.com> wrote:
> > > > > Thanks, Graham. So the conclusion is that zero Apache modules should
> > be
> > > > > necessary.
>
> > > > > I suspect that after reading the docs before posting, but mainly I
> > wanted
> > > > to
> > > > > confirm that here. And I suppose I should have just been more clear
> > about
> > > > > that from the start.
>
> > > > > So, my working conclusion from reading the docs, and this thread, is
> > that
> > > > > none of the modules I listed above are necessary. And that's good
> > because
> > > > > I'd like to kill them out, because I think they are contributing to
> > > > > unnecessary "lsof" overhead on my machine.
>
> > > > I would be less concerned about open file overhead as the dlopen
> > > > handles for the modules should be shared between all Apache processes.
> > > > What you would gain is a small decrease in memory footprint of the
> > > > Apache processes.
>
> > > > > Does that all sound sound to you?
>
> > > > If you have an issue with number of file open, I would be ensuring you
> > > > aren't using prefork MPM and running using mod_python or embedded mode
> > > > of mod_wsgi. This methods result in more Apache processes and thus
> > > > more open files. Better to use worker MPM or daemon mode of mod_wsgi
> > > > and limit number of processes.
>
> > > > So, what is the real problem you are trying to solve?
>
> > > > Graham
>
> > > > > Thanks again,
>
> > > > > Ben.
>
> > > > > On Mon, May 25, 2009 at 4:07 PM, Graham Dumpleton <
>
> > > > > graham.dumple...@gmail.com> wrote:
>
> > > > > > On May 26, 5:20 am, Ben Welsh <ben.we...@gmail.com> wrote:
> > > > > > > Sorry to have been too brief.
>
> > > > > > > My objective is to rely as completely as possible on the Django
> > > > > > > authentication methods. The only auth I need is
>
> > > > > > > 1) admin login for CMS managment
> > > > > > > 2) staff_member_required protections for certain pages (for
> > example
> > > > > > content
> > > > > > > preview pages that link out of the admin)
>
> > > > > > > The machine won't be managing any media, so, as far as I can
> > think,
> > > > > > there's
> > > > > > > no need for anything in the filesystem -- outside of the database
> > --
> > > > to
> > > > > > be
> > > > > > > accessed.
>
> > > > > > > Thanks for the advice everyone.
>
> > > > > > Then use inbuilt Django mechanisms for form/session based login.
> > You
> > > > > > don't need any special Apache modules at all for that. Start by
> > > > > > searching for 'authentication' in Django documentation.
>
> > > > > > Graham
>
> > > > > > > On Sun, May 24, 2009 at 2:56 AM, V <viktor.n...@gmail.com>
> > wrote:
>
> > > > > > > > AFAIK there are thousands of ways to combine Apache+Django for
> > > > > > > > authentication.
>
> > > > > > > > Just to name a few:
> > > > > > > > * no apache, just django: you can define custom authentication
> > > > methods
> > > > > > > > (or even Basic Auth) with django. See the docs [1]
> > > > > > > > * apache handles authentication using django as the backend.
> > See
> > > > the
> > > > > > > > docs [2]. This is described with mod_python, but mod_wsgi is
> > > > possible
> > > > > > > > as well, but I couldn't find the docs in 10 secs.
> > > > > > > > * apache handles authentication, and passes the REMOTE_USER to
> > your
> > > > > > > > django site. Set the docs [3]
> > > > > > > > * apache handles authentication, but still passess all the auth
> > > > data
> > > > > > > > to django: by default this won't happen with mod_wsgi, but can
> > be
> > > > > > > > allowed. See the docs of mod_wsgi.
>
> > > > > > > > I hope you will find above the setting you are interested in.
> > :)
>
> > > > > > > > [1]:
>
> > > >http://docs.djangoproject.com/en/dev/topics/auth/#other-authenticatio.
> > > > > > ..
> > > > > > > > [2]:
>
> >http://docs.djangoproject.com/en/dev/howto/apache-auth/?from=olddocs
> > > > > > > > [3]:
> >http://docs.djangoproject.com/en/dev/howto/auth-remote-user/
>
> > > > > > > > have a nice day!
>
> > > > > > > > On May 23, 11:57 am, Graham Dumpleton <
> > graham.dumple...@gmail.com>
> > > > > > > > wrote:
> > > > > > > > > On May 23, 5:59 am, palewire <ben.we...@gmail.com> wrote:
>
> > > > > > > > > > The default httpd.conf loaded on my CentOS server contains
> > the
> > > > > > > > > > following authentication modules.
>
> > > > > > > > > > LoadModule auth_basic_module modules/mod_auth_basic.so
> > > > > > > > > > LoadModule auth_digest_module modules/mod_auth_digest.so
> > > > > > > > > > LoadModule authn_file_module modules/mod_authn_file.so
> > > > > > > > > > LoadModule authn_alias_module modules/mod_authn_alias.so
> > > > > > > > > > LoadModule authn_anon_module modules/mod_authn_anon.so
> > > > > > > > > > LoadModule authn_dbm_module modules/mod_authn_dbm.so
> > > > > > > > > > LoadModule authn_default_module
> > modules/mod_authn_default.so
> > > > > > > > > > LoadModule authz_host_module modules/mod_authz_host.so
> > > > > > > > > > LoadModule authz_user_module modules/mod_authz_user.so
> > > > > > > > > > LoadModule authz_owner_module modules/mod_authz_owner.so
> > > > > > > > > > LoadModule authz_groupfile_module
> > > > modules/mod_authz_groupfile.so
> > > > > > > > > > LoadModule authz_dbm_module modules/mod_authz_dbm.so
> > > > > > > > > > LoadModule authz_default_module
> > modules/mod_authz_default.so
>
> > > > > > > > > > I'm curious which, if any, of them are necessary to use
> > Apache
> > > > to
> > > > > > > > > > solely run a Django application with authentication. I've
> > > > consulted
> > > > > > a
> > > > > > > > > > few people I trust and received different answers, so I
> > thought
> > > > I'd
> > > > > > > > > > just fire away a question here.
>
> > > > > > > > > > Thanks in advance for your expertise. I find this list a
> > > > constant
> > > > > > > > > > source of help and encouragement.
>
> > > > > > > > > You haven't supplied enough information.
>
> > > > > > > > > What type of authentication? Are you wanting to use HTTP
> > Basic of
> > > > > > > > > Digest authentication and have Apache handle it, or do you
> > want
> > > > to
> > > > > > use
> > > > > > > > > form/session based authentication with Django handling it? I
> > > > suspect
> > > > > > > > > you can also have Django handle HTTP Basic authentication as
> > > > well.
>
> > > > > > > > > So, you are going to have to be clearer about what you are
> > > > wanting to
> > > > > > > > > do.
>
> > > > > > > > > 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to