For the second part, just set up a cron job that runs a script that calls
`free`, parses out the free memory (using `awk`) and if it's less that
whatever you deem critical, outputs that fact with `echo`.  if everything's
ok, it shouldn't output anything.  Here's a functional version, just change
the MEM_REQUIRED variable to be the amount you need to have less than before
a notification is sent (in KB).


#!/bin/sh
MEM_REMAINING=`free | awk '/buffers\// { print $4 }'`
MEM_REQUIRED=100000
if [ $MEM_REMAINING -lt $MEM_REQUIRED ]; then
    echo "low memory: $MEM_REMAINING"
fi


cheers,
barneyb

  _____  

From: Matthew Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 9:01 AM
To: CF-Linux
Subject: CFMX 6.1 Memory Problems

Dear All,

The load on one of our servers (CFMX 6.1, Red Hat Advanced Server 2.1 ES,
Apache 1.3 connecting to
MySQL datasources on a separate box) has recently increased and the memory
usage by CFMX has gone
through the roof.  We used to need to re-start the box every fortnight but
now it is only lasting a
matter of 48 hours or so.

Firstly, does anyone have any configuration tips for getting CFMX to better
manage the available
server memory?  It doesn't seem to ever release the memory and a complete
system reboot seems to be
the only way to clear it.  We currently have 1.25Gb installed and the
simplest solution would be to
just add more physical RAM but surely there is a way to get CFMX to better
handle the available
RAM?!

Secondly - and slightly off-topic - but does anyone know of a Linux utility
which can be run on the
server (a bit like 'top') and would send an email when the available RAM
falls below a certain
level?  It would make managing the machines a lot easier!

Many thanks.

Kind regards,

Matt.
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to