Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th March 2010, 21:29
dpicella dpicella is offline
Senior Member
 
Join Date: Apr 2009
Posts: 116
Thanks: 9
Thanked 8 Times in 7 Posts
Question Debug mysqld goes offline

I have a production server with mysql database that keeps going offline. I have to restart mysqld to bring it back up. This happens about twice a day.

Running Software:
fedora 12
php 5.3.1 with cgi/fastcgi
mysql 5.44.1 with odbc support enabled
apache 2.2.14-1

Mainly this server handles data entry through a web interface. However, we have some data reports that we run through microsoft access (there is a msaccess db that some users have on their desktops that can perform these queries and reports) that links to the tables with an odbc driver version 5.1

How can I track this down? I don't see anything unusual in /var/log/mysqld.log

Observations
1. Just migrated to new fedora 12 server from fedora 10 server. Same problem existed on the previous server.
2. Running msaccess queries does not cause mysqld to freeze. These queries do execute successfully.

I suspect some sort of memory problem since the server will be fine for a while but then fail after a period of increased use for apparently no reason. Could this be related to Innodb settings for mysql or perhaps hard drive "write-back" cache? Would adjusting my settings in /etc/my.cnf be helpful?

http://dev.mysql.com/doc/refman/5.0/...iguration.html

Stumped ... any help - thanks in advance!
Reply With Quote
Sponsored Links
  #2  
Old 26th March 2010, 02:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by dpicella View Post
I suspect some sort of memory problem
I'm assuming the same. Do you have munin installed? It might help you track down the problem. Also, you can install monit which can automatically start MySQL if it's not running.

http://www.howtoforge.com/server_mon...monit_fedora_7
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 31st March 2010, 03:14
dpicella dpicella is offline
Senior Member
 
Join Date: Apr 2009
Posts: 116
Thanks: 9
Thanked 8 Times in 7 Posts
Default

Quote:
Originally Posted by falko View Post
I'm assuming the same. Do you have munin installed? It might help you track down the problem. Also, you can install monit which can automatically start MySQL if it's not running.

http://www.howtoforge.com/server_mon...monit_fedora_7
I installed munin and monit. Thank you! I am close to solving this but here is the situation now.

The munin memory chart suggests to me that I have a memory leak in an application. It rises linearly until the swap is nearly maxed out then drops off shortly before mysql is noted to fail.

Check it out: http://picella.com/wiki/docs/memory.pdf

I have a number of php scripts running ... perhaps I have persistent connections somewhere? I have written a number of my own php scripts and I can see in mysql that one there are quite a few processes open by one of the database users that my scripts rely on.

Hmmm...

Does anyone know how to track this down? Shouldn't php scripts close all open connections at the termination of the script?

See the attachement

http://picella.com/wiki/docs/memory.pdf
Reply With Quote
  #4  
Old 5th April 2010, 18:37
dpicella dpicella is offline
Senior Member
 
Join Date: Apr 2009
Posts: 116
Thanks: 9
Thanked 8 Times in 7 Posts
 
Default php memory leak problem

Quote:
Originally Posted by dpicella View Post
I have a number of php scripts running ... perhaps I have persistent connections somewhere? I have written a number of my own php scripts and I can see in mysql that one there are quite a few processes open by one of the database users that my scripts rely on.
Looks like I solved this problem. It had to do with

$xml = simplexml_load_file(URL);

I released the memory at the end of the script with

unset($xml);

... and now everything is good.

Here is the new chart. You can see the memory leak is not occurring anymore when running this script every 5 min in crontab.

http://picella.com/wiki/docs/memory2.pdf
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default .htaccess/index.html getting restored? StrikerNL Installation/Configuration 11 1st July 2009 14:12
High on Lenny - Lvm Mount Problem Serverman Technical 1 23rd June 2009 16:26
XEN on Centos 5.2 HOWTO problem bradley HOWTO-Related Questions 9 5th December 2008 21:31
/tmp filled with clamav files --> user over quota ArnOS Installation/Configuration 28 15th March 2008 09:19
Xen 3.0.2 /3.0.3 | No Swap in DomU Merc HOWTO-Related Questions 10 27th March 2007 11:40


All times are GMT +2. The time now is 11:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.