>Hi, I have a freebsd 4.10 server (x86) and I run a>shell script as a cron job every 15 minutes. This
>scripts enter some data in the mysql database.The server is caching too many open files (tables).>The server works fine for a few days, but after
>5 days it crashes. I only get this error and cannot
>do anything else (except rebooting)
>kern.maxfiles limit exceeded by uid 500 please see tuning(7)
To see this, you might try using a program like 'lsof'.
It is possible that mysqld has a file descriptor leak.
Or it is just caching too many tables.
What is the setting on the mysqld variable 'open_files_limit'?>uid 500 is mysql, so I would like to know why
>mysql is causing this error? why does it need
>to open that much files? my current kern.maxfiles
>is 1064, shouldn't this be enough?
You might want to set this lower (definitely lower than
kern.maxfiles) to prevent it from taking over the system.
One possibility.>What should I do this fix that?
>
>add sysctl kern.maxfiles=4256 to /etc/rc.local?
>or should I recompile the kernel with a new maxfiles
>value?Yes, I think you can set the variable open_files_limit>Is there a way to configure mysql to open
>less files?
lower.
If your shell script doesn't have a huge number of copies of>Can my shell script be the culprit? It does something like
>this:
itself running at once (due to server locking or just the
queries take a lot of CPU and disk I/O to finish), probably
not.
Gordon L. Burditt>
>if [ "`echo | ${mysqlbin} 2> /dev/stdout`" ]
>then
> echo "CREATE DATABASE ${mysqlname};" | ${mysqlpath}
>--user=${mysqluser} --password=${mysqlpass}
> echo "CREATE TABLE Average (Time DATETIME, AverageBar TINYTEXT,
>Average FLOAT);" | ${mysqlbin}
> echo "CREATE TABLE DBInfo (No TINYINT UNSIGNED, Server TINYTEXT);" |
>${mysqlbin}
>fi
>
>echo "INSERT INTO Average (Time, AverageBar, Average) VALUES
>('${sqltime}', LOAD_FILE('${tmpfile}.win'), '${avgtotal}');" |
>${mysqlbin}
>
>Thanks
>
Bookmarks