Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Nov 1998 17:55:29 +1300 (NZDT)
From:      Andrew McNaughton <andrew@squiz.co.nz>
To:        "USWW (United States Wide Web)" <unix@usww.com>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: Cannot Fork/kvm read:Bad address
Message-ID:  <Pine.BSF.4.05.9811211706320.443-100000@aniwa.sky>
In-Reply-To: <365314B0.51BE@usww.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Nov 1998, USWW (United States Wide Web) wrote:

> I Still have a massive problem with "500 Internal Server Error" with
> kvm_read errors running cgi's. I maintain a total of 47 machines around
> the US all of them that have any anount of traffic are having these
> problems. I have 5-6 locations ready to bailout and go back to Linux if
> I can not solve it. I have sent Email to some groups with no response. I
> have read several hundred reports about this online with no resolve.
> Jordan or some one I need your help quickly. Tech support told me to
> email you since they did not have an up to date phone number.


> Here is a bit more information about the system problem it appears that
> kvm is coming in to play here. Once the cannot fork error starts showing
> up in the apache error log file. If I HUP apache it will work ok for
> about 30 minutes. In top it appears as though I have lost memory and
> vmstat is reporting major page faults. Under no conditions can I get the
> kvm_read: Bad Address to re-cycle. Is there a way while the system is
> running that I can re-init the kernels virtual memory? Server loads are
> running at average 2.05, 3.20, 2.15.

I've had resource limit problems with my server.  My problems have been
with file handles and number of processes, but it sounds like yours is
with memory.  I found very little log information to indicate the problem,
which might be considered to be a flaw in either the resource limit
implementation or my more or less standard syslogd.conf.  

It was the per user/process limits rather than the system wide limits that
were the important ones in my case.  My solution has been to modify the
apachectl script to include calls to ulimit.

Other useful techniques included a once/minute cron job putting
info about resource consumption into a log - useful mostly because it told
me that it wasn't the system limits that were the problem.  I wasn't even
close to them.

echo `date`, `pstat -T`, `sysctl vm.loadavg` >> /var/log/uptime.log 2>&1

Also I used a tiny cgi script to verify that the resource limits
were what I thought they were supposed to be:

#!/bin/sh
echo "Content-Type: text/html"
echo
echo "<PRE>"
limits
echo "</PRE>"


This may not be your problem - Your comments about what you see through
top and vmstat make me think maybe it's not.  In any case, it's something
you'll likely run into sooner or later, and quick to check.

Questions for someone: 

* Is there a way to get the resource usage for the a process to see how
close a process is to it's limits?

* is there a way to get syslog entries where resource limits are enforced?
(and particularly where that kills a process)


Andrew


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9811211706320.443-100000>