LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-31-2003, 02:38 AM   #1
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Rep: Reputation: 15
cron memory usage


My box runs out of memory while doing it's daily cron jobs, which causes all instances of apache to be killed.

/etc/cron.daily scripts are: 0anacron, 5snort, calender, exim, find,logrotate,man,modutils,netbase,netkit-inetd, standard and syslogd. Which one of these scripts can be eating the memory at execution, or how can I determine that?

cron.daily scripts should be run at 6.25 according to crontab, but the jobs are excuted at 7.30. What's causing the difference?

I read that most/all linux use a caching mechanism, causing the system always to use about 90% of the available memory. Most of the time, my system uses about 25% (11Mb) of virtual memory. Do I need to worry about that?

So far the questions, I have added some info below. I know my hardware is limited, but I know it is possible to run a small web server on it.

I hope someone can help.

Gilion

System:
i486dx
8Mb RAM
32Mb Swap
341Mb diskspace
Debian stable = 3.0 woody
Linux Kernel 2.4.18

crontab:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
25 6 * * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root test -e /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.monthly

Syslog's tail:
Oct 31 07:30:01 MIR /USR/SBIN/CRON[14914]: (root) CMD (test -x /etc/init.d/anacron && /etc/init.d/anacron start >/dev/null)
Oct 31 07:30:02 MIR anacron[14917]: Anacron 2.3 started on 2003-10-31
Oct 31 07:30:02 MIR anacron[14917]: Will run job `cron.daily' in 5 min.
Oct 31 07:30:02 MIR anacron[14917]: Jobs will be executed sequentially
Oct 31 07:35:03 MIR anacron[14917]: Job `cron.daily' started
Oct 31 07:35:03 MIR anacron[14921]: Updated timestamp for job `cron.daily' to 2003-10-31
Oct 31 07:38:40 MIR kernel: Out of Memory: Killed process 14309 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 14309 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 14328 (apache).
Oct 31 07:39:36 MIR last message repeated 2 times
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 14335 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 14336 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 14336 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 13213 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 13213 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 13215 (apache).
Oct 31 07:39:36 MIR kernel: Out of Memory: Killed process 13451 (apache).
Oct 31 07:39:37 MIR kernel: Out of Memory: Killed process 13451 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 13212 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 13211 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 13211 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 13214 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 13214 (apache).
Oct 31 07:39:39 MIR kernel: Out of Memory: Killed process 494 (apache).
Oct 31 07:39:39 MIR kernel: VM: killing process apache
Oct 31 07:39:38 MIR dhclient: DHCPREQUEST on eth0 to 131.155.239.140 port 67
Oct 31 07:39:39 MIR dhclient: DHCPREQUEST on eth0 to 131.155.239.140 port 67
Oct 31 07:39:39 MIR dhclient: DHCPACK from 131.155.239.140
Oct 31 07:39:41 MIR /USR/SBIN/CRON[15022]: (mail) CMD ( if [ -x /usr/sbin/exim -a -f /etc/exim/exim.conf ]; then /usr/sbin/exim -q ; fi)
Oct 31 07:39:46 MIR dhclient: bound to 131.155.228.107 -- renewal in 747 seconds.
 
Old 10-31-2003, 03:06 AM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
"8Mb RAM"

Maybe you should get some more RAM?
 
Old 10-31-2003, 04:00 AM   #3
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
could you try staggering those. take some of that stuff out of cron.daily and give them different times to run so that they dont all run at once.
 
Old 11-10-2003, 01:05 PM   #4
Gilion
Member
 
Registered: Sep 2003
Location: Netherlands
Distribution: Debian 3.0
Posts: 78

Original Poster
Rep: Reputation: 15
I've pinned it down to the memory usage of logrotate. Isn't that supposed to be a very basic tool? How can an application like that cause overflows on virtual memory?

Something else I noticed. The rotation of the logs is handled in with syslog script, creating syslog.0 syslog.1 etc. Is that one still necessary after instal of logrotate?

Gilion
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron.daily sends me a logrotate Kill usage message. pollardd Linux - General 1 09-02-2005 12:18 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 05:55 AM
Memory Usage? LiquidIce Linux - General 4 04-29-2003 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration