Help - Search - Members - Calendar
Full Version: Problems on my Raq
The Planet Forums > System Administration > Server Hardware > RaQ Support
pgowder
Problems on my Raq
For the past several weeks I've been getting messages every morning that there is a memory problem:

From:
To: sys
Date: 3/27/02 4:30AM
Subject: The Sun Cobalt server is very low on memory

Memory on the Sun Cobalt server is heavily used.
The Sun Cobalt server needs more memory than it currently has.
Consider adding more DRAM to the server.

Total memory is: 389092 KB
Used memory is: 380488 KB
Free memory is: 8604 KB
Percent used is: 97

Then the past three days I have recieved this email:

Over the past fifteen minutes, the CPU has been heavily loaded.

This will result in noticible performace loss. Consider moving some of the
services to other Sun Cobalt servers, or reduce the complexity of the CGI
scripts running on the Sun Cobalt server itself.

1 minute load average: 3.97
5 minute load average: 7.73
15 minute load average: 6.94


And the past two mornings MySQL has crashed, and I've had to reboot.

What could be causing this?? How can I fix it??

Help!!
Shortfork
From the looks of the server times, this is happening during the split logs and parsereport.pl and perhaps webalizer if you are running it that are part of the daily cron job that happens every morning about 4:05 (when it begins) If you have really large log files, this might be the problem or if during that period, you have a lot of traffic to the website, there could be problems.

If the usage of the machine during that time period is high (it would likely not be if most of your traffic is from the US time zones) then you might try to change the timing of the cron job, or, set the server to your time zone, if it's not already.

Shortz
pgowder
Yes, I am running webalizer.

I do have some users on during that time.

Can I adjust the size of the logs?

How do I move the cron time?
Shortfork
QUOTE
Originally posted by pgowder
Can I adjust the size of the logs?

How do I move the cron time?
LOL.. I was afraid you'd ask that.. :confused:

To change times in /etc/crontab

http://www.superscripts.com/tutorial/crontab.html

Is a tutorial on how to do it. I just tried the crontab editor and could not figure out how to get out of the damn thing so be very careful..

Actually, the above one is pretty sparse in "how to" but go to google.com and do a search with crontab tutorial and you'll find some useful links. It does not look too hard, what I hit on when I did crontab -e was vi.. which I don't know crap about so tht is why I could not get out of it..

Also, I believe Mouse set up his system to rotate the logs more than once a day and this solved his problem.. Also, adding some more memory might help you..

Other than that.. I'm about as clueless to help you as I am to figure out if I screwed up crontab trying to get out of it :eek:

Shortz
daviddel
I am not too sure about the log rotate thing. I do know that Cobalt sets the max size of the log in the /etc/logrotat.d/ directory. I am not sure if you want to mess with them.

As for the crontab, below is a copy of my crontab file. The way I run new items is to put them in the proper directory. Like if I want to run a script called "something.sh" once a day, I would put it in the /etc/cron.daily directory and make it excutable by root. Then from the script below it would run 0202 or 2:02 AM every day.

Lets take a closer look at scheduling the times.
There are 5 asterisks, the first being minute and the last being day of week.

MINUTE(0-59) HOUR(0-23) DAYOFMONTH(1-31) MONTHOFYEAR(1-12) DAYOFWEEK(0-6) Note 0 = Sun

Also note that the ASTERISK (*) is what's called a WILDCARD meaning it will match any value.

So lets run a script every day at 5:00PM
* 17 * * *
How about every Wednesday at 5:00 PM
* 17 * * 4
How about the 15th of every month at 9:05 in the morning.
05 9 15 * *
Okay one more, How about the 15th and 30th of every month at 9:05 in the morning.
05 9 15,30 * *
Well I guess you get the drift.

If you look below I changed my cron.daily to run at 2 AM instead 4 AM. There was a problem a while ago with all of the servers running webalizer at 4 AM. I also added /etc/cron.quarter-daily to run some stats programs.

Besides updating this file and and adding the scripts to the proper cron directory all works as expected.

(crontab file)
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 2 * * * root run-parts /etc/cron.daily
03 1,7,13,19 * * * root run-parts /etc/cron.quarter-daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

# Monitor services to make sure everything is still okay.
0,15,30,45 * * * * root /usr/local/sbin/swatch >>/var/cobalt/adm.log 2>&1
(end crontab filre)
icon_smile.gif
Shortfork
QUOTE
Originally posted by daviddel
I am not too sure about the log rotate thing.  I do know that Cobalt sets the max size of the log in the /etc/logrotat.d/ directory.  I am not sure if you want to mess with them.
You can with no problem on the site split logs, not sure on the main /var/log/httpd/access log before it's split though.

I've done the site logs rotate size and it was not a problem but I don't think that's where the problem comes in anyway. I'ts probably more with access log and I don't know what would happen there as I think it rotates that one out every day anyway.

I suspect it's more to do with the other processes that are running during his log processing though. Particularly SQL as I've gotten caught out doing a huge search and replace script thing and log rotate session started. The search and replace thing was running over 50% resources and when splitlogs started running I had a heart attack thinking I was going to crash this puppy for sure but nope..

I suspect SQL is a little more finicky and that might be it..??

Shortz
pgowder
If it is MySQL, what do I need to do?
pgowder
I've unistalled webalizer to see if that will help.

It crashed again last night.
Shortfork
QUOTE
Originally posted by pgowder
I've unistalled webalizer to see if that will help.

It crashed again last night.
I've found the overhead with webalizer to be pretty low compared to parsereport.pl and split logs. Even running a very detailed webalizer.conf file that someone suggested here that winds up running for about an hour, I've not had any problems.

Likely not your problem.

Shortz
pgowder
Where is parselog.pl and split logs set?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.