[nSLUG] Re: Running out of swap space????

D G Teed donald.teed at gmail.com
Tue Jun 6 18:46:25 ADT 2006


Hi,

Do you have use of ulimit in BSD 6.0?
It can control the virtual memory and other
resources given to users.

In 4.11 version of BSD I see config settings
in /etc/login.conf that allow tuning of
vmemoryuse and others.  I don't know
if that carried on into 6.0.

It probably doesn't fix the problem but provides
some throttling control until you can find out what
running rampant.  I'd start with taking a look
at how open mysql is running.  Does it need
tcp/ip port open?  It often won't if running on
the same machine as the web server, but people
often needlessly let mysql run with TCP/IP port open.

Your can disable networking access to mysql
by setting this in my.cnf:

[mysqld]
skip-networking


See:

http://www.softpanorama.org/DB/Mysql/mysql_security.shtml

For more tips.

--Donald


On 6/6/06, Bill Moran <wmoran at collaborativefusion.com> wrote:
> On Tue, 06 Jun 2006 09:13:22 -0500
> Paul Schmehl <pauls at utdallas.edu> wrote:
>
> > cknipe at savage.za.org wrote:
> > > Quoting bob.middaugh at comcast.net:
> > >
> > >>> -------------- Original message ----------------------
> > >>> From: pauls at utdallas.edu
> > >>> +pid 37308 (mysqld), uid 88, was killed: out of swap space
> > >>> +swap_pager: out of swap space
> > >>> +swap_pager_getswapspace(1): failed
> > >>
> > >> If you kill mysql server, does the swap space free up?  Are there any known
> > >> issues between the version of MySQL that you're running and FreeBSD 6.0?
> > >
> > > MySQL not having a properly tuned config file for the system it runs on?  It is
> > > known to consume vast amounts of resources if not properly configured...
> > >
> > I wrote a one line shell script that runs swapinfo -h and cron'd it to
> > run once an hour.  Each hour the amount of swap space being used has
> > increased by 100 to 200 MB.  Eventually swap is exhausted and the system
> > kills a binary.  (It's not just mysql.  Other things are being killed as
> > well.)
>
> This is typical.  I believe that the process killed is the one swapped out
> the longest, or maybe it's random?  Either way, the one killed usually
> isn't the one using all the memory.
>
> > What would cause swap to increase steadily like that?  Something not
> > releasing swap when it's no longer needed?
>
> One of two things:
> 1) You have misconfigured an application to think it has _way_ more memory
>    available than it does, so it just keeps using more and more memory,
>    because you told it that it was OK to do so.
> 2) You are running an application with a memory leak.  Meaning: it allocates
>    memory, then loses track of said allocation and re-allocates it later.
>    Since it lost track, it's no longer using the memory, but can't tell
>    the kernel to release the memory for other applications to use either.
>    This is a bug in the application, not FreeBSD.
>
> If you provide the full output of top to the list, I'm sure some problem
> will jump out for someone on the list.  Wait till the system is close to
> having no swap, then do "top > somefile" and paste the file into your
> mailer.
>
> --
> Bill Moran
> Collaborative Fusion Inc.
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>

!DSPAM:4485f7b727631460717289!




More information about the nSLUG mailing list