By andrewtf on
We're getting constant errors on our Drupal site: either out-of-memory errors like this:
Fatal error: Out of memory (allocated 56623104) (tried to allocate 10279957 bytes) in C:\www\docs\includes\database.mysql.inc on line 301
or connection resets or occasionally even the dreaded "MySQL server has gone away".
Researching the issue here points to a resource or settings problem with the database server, but our server admins in the IT department have maxed out all the settings on the web and MySQL servers and that shouldn't be an issue.
Right now it seems that the site is trying to consume gigbytes worth of memory doing something—what I'm not sure. Any ideas?
Comments
You probably have some custom
You probably have some custom code that is running recursively and never escapes.
This is very likely since you're hitting both MySQL errors and memory allocation problems.
Thanks
I'll check out that avenue. Not sure what it would be, but then I'm at a loss everywhere else at this point so it's a place to start.
Still trying to figure it out
Removed the site's custom code and found it didn't make much of a difference. Tried tracking down anything that was causing PHP errors in the dblog, too. Any other ideas? I notice that we're usually OK adding content or editing it, but trying to change a site setting sends the server way out into error-land.
Other possible issues: Are
Other possible issues:
Thanks again!
Thanks for the great suggestions!
The site is definitely views-heavy, so I'll check out the queries and see what I come up with. AFAIK there's nothing too complex at work there, but you never know.
I'll ask our server admins about a 3rd-party cache. It's something I've looked into already, and you're confirming it's a good idea.
The site is on a dedicated Apache server that supposedly has tons of power and resources behind it, but MySQL is not (I'm pretty sure) running on the same server.
One more thing to mention: We have a sandbox environment set up with the exact same site, and it runs flawlessly, so either the problems on the live site are because it's under a load (252 anonymous users as I write this) or because of the hosting environment.
Fixed! (I think)
After a huge amount of troubleshooting and even some back-and-forth with a Drupal hosting consultant, I think our sysadmin finally managed to solve this problem by limiting the number of MySQL connections available to Drupal to 20. Not sure how he arrived at this idea, but as soon as he did it the site stabilized and all became right with the world, at least for the time being.