On Aug 21, 5:43 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> The official mod_python mailing list details are atwww.modpython.org.
> You posted to the mod_python Google group which no one uses.
>
> Also look through:
>
>  http://blag.whit537.org/2007/07/freebsd-threads-apache-and-modwsgi.html
>
> and specifically the other pages it links to. You may need to work out
> which threading library Python is wanting to use and which Apache may
> be picking up. If they are different you may need to tweak system
> config file to override which threading library is going to be used so
> it is consistent and no possibility of conflict.
>
> You might also try and find a FreeBSD specific mailing list to raise
> your problems.
>
> Also try mod_wsgi perhaps, but if it relates more to mixing Python and
> Apache, then would expect you to see the same problem.
>
> Graham
>
> On Aug 22, 3:25 am, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Aug 20, 6:38 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Aug 20, 5:13 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>
> > > > On Aug 20, 12:13 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > On Aug 20, 3:01 pm, Sasha Weberov <[EMAIL PROTECTED]> wrote:
>
> > > > > > Is it normal to experience a sudden sharp spike in cpu and memory
> > > > > > usage for about a minute or so after a start/stop and restart? I'm
> > > > > > running the pre-fork mpm, FreeBSD 6.2, and latestmod_python. I've
> > > > > > tried disableingmod_pythonand it went away, so it's clearly mod
> > > > > > python. I know that the pre-fork mpm has dummy connections to signal
> > > > > > processes to die off and that's evident in logs, can it be causing 
> > > > > > the
> > > > > > spike because it's hitting " / "? I've tried the rewrites and all, 
> > > > > > but
> > > > > > notta.
>
> > > > > > Any suggestions would be greatly appreciated.
>
> > > > > Do you see the spike as soon as you start Apache but before you even
> > > > > try and access your Python web application, or does it only occur when
> > > > > you first access the Python web application? If the latter, have you
> > > > > tried a simple 'mptest' example as permod_pythondocumentation and
> > > > > does it exhibit the same problem? Ie., eliminate it being anything to
> > > > > do with Django, in which case you would be better off asking on the
> > > > >mod_pythonmailing list.
>
> > > > > Other things to look at are whether your Python has been built to use
> > > > > shared libraries or not. If it hasn't and yourmod_python.so is large
> > > > > because it incorporates Python library, you will potentially be stuck
> > > > > with private copy of Python library in every process and if you are
> > > > > running with minimal memory on your system with lots of prefork
> > > > > processes, you may well be running out of main memory and the box is
> > > > > busily swapping to disk. How big are your Apache child processes on
> > > > > initial startup and then subsequently after you have accessed your
> > > > > Python web application? How big is yourmod_python.so module file.
>
> > > > > Graham
>
> > > > It happens as soon as Apache is started, or restarted. <y processes on
> > > > average are 15-30mb.
>
> > > What other non standard Apache modules do you have loaded? That is
> > > quite a lot of memory being used before anything actually happens,
> > > although not entirely clear whether you are stating the whole virtual
> > > memory of the processes or only resident memory.
>
> > No other non-standard modules. I'm looking at resident memory.
>
> > > How complicated is your Apache configuration. Do you do anything out
> > > of the ordinary like define lots of VirtualHost containers? Do you use
> > > PythonImport directive in your Apache configuration?
>
> > Not very complicated, only 2 vhosts, 1 php, and 1mod_python(Django)
>
> > > Do you know whether your Apache web server is compiled with --enable-
> > > threads? Running:
>
> > >   httpd -V
>
> > Server version: Apache/2.2.4 (FreeBSD)
> > Server built:   Jul 19 2007 23:34:23
> > Server's Module Magic Number: 20051115:4
> > Server loaded:  APR 1.2.8, APR-Util 1.2.8
> > Compiled using: APR 1.2.8, APR-Util 1.2.8
> > Architecture:   32-bit
> > Server MPM:     Prefork
> >   threaded:     no
> >     forked:     yes (variable process count)
> > Server compiled with....
> >  -D APACHE_MPM_DIR="server/mpm/prefork"
> >  -D APR_HAS_SENDFILE
> >  -D APR_HAS_MMAP
> >  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
> >  -D APR_USE_FLOCK_SERIALIZE
> >  -D APR_USE_PTHREAD_SERIALIZE
> >  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
> >  -D APR_HAS_OTHER_CHILD
> >  -D AP_HAVE_RELIABLE_PIPED_LOGS
> >  -D DYNAMIC_MODULE_LIMIT=128
> >  -D HTTPD_ROOT="/usr/local"
> >  -D SUEXEC_BIN="/usr/local/bin/suexec"
> >  -D DEFAULT_PIDLOG="/var/run/httpd.pid"
> >  -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
> >  -D DEFAULT_LOCKFILE="/var/run/accept.lock"
> >  -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
> >  -D AP_TYPES_CONFIG_FILE="etc/apache22/mime.types"
> >  -D SERVER_CONFIG_FILE="etc/apache22/httpd.conf"
>
> > ^ No Doesn't look like it is.
>
> > > Is your Python compiled with threads? You can tell by trying to import
> > > 'threading' from interpreter.
>
> > > $ python
> > > Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
> > > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
> > > Type "help", "copyright", "credits" or "license" for more information.
>
> > > >>> import threading
>
> > I was able to type "import threading". Does that mean it's compiled
> > with threads? I'm using Python 2.5.
>
> > > FreeBSD still appears to have various problems with its threading when
> > > using Apache. If Python is using threading and Apache isn't, there may
> > > be a clash in terms of which threading libraries are used. I know
> > > people who simply haven't been able to get threaded Apache to work at
> > > all on FreeBSD.
>
> > I see, I don't believe I have anything threaded unless it's Python
> > that is threaded.
>
> > > You might want to take this whole issue over to themod_pythonmailing
> > > list as it would appear not to be Django specific, unless you are
> > > using PythonImport to import a module which is in turn import Django
> > > at Apache startup rather than first request.
>
> > I've tried and got no reponse. I recently disabled my django app, left
> > trac running, and restarted the web server and don't have the lag
> > problems. So it has to be Django or the Django app itself.- Hide quoted 
> > text -
>
> - Show quoted text -

I see thanks. I actually setup mod_scgi and it has been working fairly
well, granted the docs are horrible (opened a ticket for a dead link).
But memcached seems to work and there is no startup resource usage
surge or anything.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to