Definitely turn off DEBUG mode :) When DEBUG mode is on all SQL queries remain in memory.
Best regards, Valts. On Fri, Apr 18, 2008 at 12:58 AM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > Hi Folks, > > I'm having trouble with Apache/Django memory usage on a Virtual Private > Server. I only have 150Mb memory. > > I've turned KeepAlive off. I think I'm using prefork (how do I tell?) and > it's set at the following: > > <IfModule mpm_prefork_module> > StartServers 2 > MinSpareServers 1 > MaxSpareServers 5 > MaxClients 40 > MaxRequestsPerChild 100 > ServerLimit 30 > </IfModule> > > php is also installed, and I have some sites using it, but I only started > getting these out of memory errors after adding django stuff in, and then > only recently. > > I've just restarted apache, exim4, spamassassin etc, and top is giving me: > > top - 22:54:32 up 4:13, 1 user, load average: 1.01, 0.85, 0.76 > Tasks: 59 total, 2 running, 57 sleeping, 0 stopped, 0 zombie > Cpu(s): 6.6%us, 0.7%sy, 0.0%ni, 56.2%id, 36.5%wa, 0.0%hi, 0.0%si, > 0.0%st > Mem: 145648k total, 141976k used, 3672k free, 552k buffers > Swap: 262136k total, 23728k used, 238408k free, 20972k cached > > which i think means I'm swapping. > > Doing a ps aux gives only the following processes using double figures % > of > memory: > > www-data 5103 0.1 13.4 38408 19568 ? S 22:39 > 0:01 /usr/sbin/apache2 -k start > www-data 5104 0.8 14.4 38696 21088 ? S 22:39 > 0:08 /usr/sbin/apache2 -k start > www-data 5118 0.3 13.7 38060 20064 ? S 22:39 > 0:03 /usr/sbin/apache2 -k start > www-data 5128 0.0 11.6 37220 17000 ? S 22:40 > 0:00 /usr/sbin/apache2 -k start > www-data 5129 0.3 13.6 36588 19816 ? S 22:40 > 0:03 /usr/sbin/apache2 -k start > root 5478 0.0 13.2 33324 19328 ? Ss 22:47 > 0:00 /usr/sbin/spamd --create-prefs --max-children > 1 --helper-home-dir -d --pidfile=/v > root 5480 0.0 18.9 35800 27588 ? S 22:47 0:00 spamd > child > > The problem I had a 5.30pm tonight was a total lack of memory, > from /var/log/messages: > > Apr 17 18:28:35 tsawyer kernel: Mem-info: > Apr 17 18:28:35 tsawyer kernel: Normal per-cpu: > Apr 17 18:28:35 tsawyer kernel: CPU 0: Hot: hi: 42, btch: 7 usd: > 31 > Cold: hi: 14, btch: 3 usd: 2 > Apr 17 18:28:35 tsawyer kernel: Active:16505 inactive:16320 dirty:0 > writeback:0 unstable:0 free:389 slab:2005 mapped:35 pagetables:585 > Apr 17 18:28:35 tsawyer kernel: Normal free:1556kB min:1560kB low:1948kB > high:2340kB active:66020kB inactive:65280kB present:152400kB pages_scanne > d:310107 all_unreclaimable? yes > Apr 17 18:28:35 tsawyer kernel: lowmem_reserve[]: 0 0 > Apr 17 18:28:35 tsawyer kernel: Normal: 1*4kB 8*8kB 15*16kB 5*32kB 1*64kB > 0*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 1556kB > Apr 17 18:28:35 tsawyer kernel: Swap cache: add 2420111, delete 2420037, > find > 844817/1198912, race 8+3621 > Apr 17 18:28:35 tsawyer kernel: Free swap = 0kB > Apr 17 18:28:35 tsawyer kernel: Total swap = 262136kB > Apr 17 18:28:35 tsawyer kernel: Free swap: 0kB > Apr 17 18:28:35 tsawyer kernel: 38400 pages of RAM > Apr 17 18:28:35 tsawyer kernel: 0 pages of HIGHMEM > Apr 17 18:28:35 tsawyer kernel: 1988 reserved pages > Apr 17 18:28:35 tsawyer kernel: 246 pages shared > Apr 17 18:28:35 tsawyer kernel: 74 pages swap cached > > How I can reduce the memory usage? Any pointers appreciated. > > Thanks, > > Tim. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---