Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: Ali_ on April 07, 2019, 06:29:00 PM

Title: $db_persist causes error "too many files open"
Post by: Ali_ on April 07, 2019, 06:29:00 PM
I've attempted to set the database persist option on my forum to ON, but when I browse to a specific page  (ADMIN >> THEMES AND LAYOUT >> MEMBER OPTIONS) it gives me this error:

Out of resources when opening file /var/tmp/#sql_56c9_0.MAI (Errcode 24 "Too many files open")
File:  /www/mysite/html/Sources/Themes.php
Line: 431

Note:  It appears that your database may require an upgrade.  Your forum's files are currently at version 2.0.15, while your database is version 2.0.  The above error might possibly go away if you execute the latest version of upgrade.php


I looked at that line of code on Themes.php, and all there is on that line is:
'custom_fields' => empty($customFields) ? array() : $customFields,

I am not sure what to do, should I not be using the $db_persist option in Settings.php ?  I thought this was supposed to help with performance as it suggests in the help field.  Am I supposed to upgrade my database?  I upgraded things following the documentation, and things went smoothly.  I just never used $db_persist before.
Title: Re: $db_persist causes error "too many files open"
Post by: vbgamer45 on April 07, 2019, 07:07:24 PM
I don't suggest using that feature.
Too many files open means you have increase your files limit on linux for mysql and maybe the whole server.
Title: Re: $db_persist causes error "too many files open"
Post by: Ali_ on April 07, 2019, 07:13:19 PM
It's a dedicated MySQL server, I can change the MySQL conf and scale the server up if I need it.  Not that I want that.

What's the purpose of the feature? Didn't think it would cause errors instead of increasing performance.
Title: Re: $db_persist causes error "too many files open"
Post by: vbgamer45 on April 07, 2019, 07:23:24 PM
Some topics on google
https://meta.wikimedia.org/wiki/Why_persistent_connections_are_bad
https://stackoverflow.com/questions/50303/persistent-db-connections-yea-or-nay
https://stackoverflow.com/questions/44581377/what-are-the-purpose-and-benefits-of-using-persistent-connection-in-mysql
Title: Re: $db_persist causes error "too many files open"
Post by: Ali_ on April 07, 2019, 08:01:59 PM
@vbgamer45 thanks :)
Title: Re: $db_persist causes error "too many files open"
Post by: Arantor on April 08, 2019, 02:16:21 AM
What kind of performance issues are you having?

And no, for typical loads it almost certainly won't help. Used to be more relevant a long time ago but the relevant things have changed so dramatically in the intervening years.