-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OC 5.0.10 - SQLSTATE[08004] [1040] Too many connections #4407
Comments
changing the php.ini setting from -1 to 10 might have solved the issue for now - need to verify this over time:
|
@bartv2 @icewind1991 @DeepDiver1975 Edit: nvm the second statement |
Your database should always accept at least as many connections as the configured maximum number of apache/php process. |
Again getting this second time during 24 hours on 7.0.4
|
looks like your MySQL db has been shutdown??? |
Sure, I took logs right after mysql restart, because otherwise I wasn't able to get into ownCloud.
|
hmmm - can you increase the connection limit? - http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html |
Do you think 100 (current value) is not enough for container where DB is used exclusively by ownCloud with single active user with single (Desktop) client? |
all I can help you out with at the moment .. and yes - this requires deeper analysis |
I found weird thing. Stat failed on |
@nazar-pc you can try to run a rescan of the file system from the command line (using the web server user) ./oc files:scan --all |
I did, files where green, I'll see how it will behave. The root of this problem according to what I found is either unfinished DB transaction, or just not closed DB connection. Where is connection closing in ownCloud? Will it be closed if ownCloud crashed with exception (I mean |
@icewind1991 Can you answer this? |
Connections should automatically be closed if php error's out |
@icewind1991, I thought so also, but since error happened it is not always true. I mean that in some cases connection left unclosed, or some process lives too long, or something else, but something wastes all available connections from time to time. |
I had the same in 7.0.4. Issue seems pop up, once I mount a webdav share with lost of files. |
Are you still seeing this in 7.0.7 or 8.0.5 ? I remember that some queries were missing "closeCursor()", there is a chance that these resources are now properly freed which could hopefully fix your problem. |
I’m closing this issue because it has been inactive for a few months. This probably means that the issue has been fixed in a newer version. Please reopen if you still encounter this issue with the latest stable version. Thank you! |
Still hapenning in 9.0 when scanning 10.000.000+ files with mysl 5.7, also memory goes up to 1.5 GB for php.. (i had to change it in php.ini :-/. it seems the system leaks memory, and/or does not close/reuse connections... after rebooting the webserver i seen no problems, seems to relate to file scanning... large set of files... |
@Tristan79 are you able to check whether database connections are leaking ? Regarding memory, this could be similar to #23019 |
It started working! using Link and instead of 16k I used 64k... ; Determines the size of the realpath cache to be used by PHP. This value should ; Duration of time, in seconds for which to cache realpath information for a given hope that it helps anyone... still not added all my files (i reduced it so 3.500.000, that also did not work without these settings) so i am hopefull... no idea how to check for leaks at the moment... Also it always tell me it is out of disk space..,when i enter my external storage, even when i go back to the root,... seems a bug. The external folder are mounted read only, still syncing works, still have to test that better... |
This is still happening on version Exception occurred while logging exception: Failed to connect to the database: An exception occured in driver: SQLSTATE[08004] [1040] Too many connections |
Expected behaviour
Availability of DB connection to mysql after upgrading from 5.0.9 to 5.0.10
Actual behaviour
After a couple of minutes the owncloud.log shows following error message and doesn't recover until the db-server is restarted:
Steps to reproduce
a) my.cnf
b) php.ini
c) oc
Server configuration
Operating system:
Web server:
Database:
PHP version:
ownCloud version:
5.0.10
Client configuration
Browser:
reporudable in all browsers and sync client 1.3.0 for windows
Operating system:
irrelevant
Logs
Web server error log
ownCloud log (data/owncloud.log)
Browser log
The text was updated successfully, but these errors were encountered: