SMF Support > Server Performance and Configuration

"SMF Database Error!" after upgrading to MacOS High Sierra [solved]


After upgrading my MacOS system from Yosemite (10.10.5) to High Sierra (10.13.3), I was getting occasional bursts of "SMF Database Error!" emails with this message:

This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.

Along with the new operating system, MySQL was also updated from 5.6.21 to 5.7.21, so I don't know which upgrade caused the problem, but I'm guessing MySQL.

Checking the MySQL log file (/usr/local/mysql/data/mysqld.local.err) I saw lots of messages like this:

[Warning] File Descriptor 1027 exceeded FD_SETSIZE=1024

It turns out there is a hard limit of 1024 on the maximum number of file descriptors for High Sierra.  The solution was to edit /Library/LaunchDaemons/ and add this line to the mysqld options:

--- Code: ---<string>--table-open-cache=400</string>
--- End code ---

Then restart MySQL by clicking "Stop MySQL Server" then "Start MySQL Server" in the MySQL System Preferences.

The default setting for table-open-cache was 2000, which was greater than the MacOS limit.  Decreasing this to 400 has fixed my database error problems without any noticeable averse effects.

- Phil

Thanks for sharing the solution :) Some people might find that useful!

Here are a few commands that might find useful in diagnosing this problem:

1. Show your current table_open_cache setting:

--- Code: ---mysqladmin -u mysql -p variables | grep -w table_open_cache
--- End code ---

(and enter your mysql password)

2. Count the number of currently open tables:

--- Code: ---sudo lsof -p <pid> | grep MYD | wc -l
--- End code ---

(and enter your user password.  <pid> is the process ID number for mysqld)

3. Show your current mysqld version:

--- Code: ---mysqld --version
--- End code ---

- Phil

Hey Phil,

I created an account on here just to let you know that you saved the day by pointing out that the value of `table_open_cache` should be _less_ than the default of 2000, instead of more.

I've spent days tracking down this bug and your tip was the answer. Settled on a value of 900, which works great.

Thank you so much for posting this! :)



[0] Message Index

Go to full version