[Maria-discuss] MariaDB shutdowns silently
Dear all, I am currently running MariaDB in production and I often found it would shutdown itself silently after inactivity. The application itself is using Ruby on Rails. I have disabled the max_timeout settings in my.cnf but the problem still occurs. Is there anything else I should watch out for to prevent this issue continuing to occur? Thank you very much for your assistance. Kind regards, Joshua -- http://twitter.com/scrum8
Den 21-04-2010 05:51, Joshua Partogi skrev:
Dear all,
I am currently running MariaDB in production and I often found it would shutdown itself silently after inactivity. The application itself is using Ruby on Rails. I have disabled the max_timeout settings in my.cnf but the problem still occurs. Is there anything else I should watch out for to prevent this issue continuing to occur?
Thank you very much for your assistance.
When I saw this (with both MariaDB and MySQL), it was the connector that didn't renew the socket after closing as it should. This was with Java+hibernate, but it could be the same with the Rails connector. The workaround I did was to run a "select 1" just before trying a real query. If this failed, I would shut down the connection and start it again. That worked, but it's quite horrible. However, if this type of workaround works, you know the problem is in the connector to the database. If it doesn't work, then there is a higher chance that the problem is in the database. But this is the first time I've heard of this particular error. Bo.
On Tue, Apr 20, 2010 at 20:51, Joshua Partogi <jpartogi@scrum8.com> wrote:
I am currently running MariaDB in production and I often found it would shutdown itself silently after inactivity. The application itself is using Ruby on Rails. I have disabled the max_timeout settings in my.cnf but the problem still occurs. Is there anything else I should watch out for to prevent this issue continuing to occur?
Do your logs tell you when and/or why your MariaDB was shutdown?
Hi Joshua, Is your database server crashing or are you getting a 'MySQL server has gone away' error message after some inactivity period in your application? To determine if your database is crashing, check the error log. You can determine if your database is actually restarting by checking the 'uptime' value in 'SHOW GLOBAL STATUS', or by using \s in the mysql command line client. If you are getting the error message but your server is not actually restarting then there are helpful hints in the MySQL manual: http://dev.mysql.com/doc/refman/5.1/en/gone-away.html Likely you need to either increase wait_timeout or decrease your recycle time in your connection pool. -- Justin Swanhart On Tue, Apr 20, 2010 at 8:51 PM, Joshua Partogi <jpartogi@scrum8.com> wrote:
Dear all,
I am currently running MariaDB in production and I often found it would shutdown itself silently after inactivity. The application itself is using Ruby on Rails. I have disabled the max_timeout settings in my.cnf but the problem still occurs. Is there anything else I should watch out for to prevent this issue continuing to occur?
Thank you very much for your assistance.
Kind regards, Joshua
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
Hi Justin, I am getting MySQL server has gone away. I think there is an issue with how the MySQL Ruby driver establish connection to MySQL. I have been noticing that when there is inactivity in the application, MySQL would just fade away silently. I am going to monitor this again and see what is the root cause of this. Kind regards, Joshua -- http://twitter.com/scrum8 On Wed, Apr 21, 2010 at 4:50 PM, Justin Swanhart <greenlion@gmail.com> wrote:
Hi Joshua,
Is your database server crashing or are you getting a 'MySQL server has gone away' error message after some inactivity period in your application?
To determine if your database is crashing, check the error log. You can determine if your database is actually restarting by checking the 'uptime' value in 'SHOW GLOBAL STATUS', or by using \s in the mysql command line client.
If you are getting the error message but your server is not actually restarting then there are helpful hints in the MySQL manual: http://dev.mysql.com/doc/refman/5.1/en/gone-away.html
Likely you need to either increase wait_timeout or decrease your recycle time in your connection pool.
Hi Joshua On 21/04/2010, at 3:07 AM, Joshua Partogi wrote:
I am getting MySQL server has gone away. I think there is an issue with how the MySQL Ruby driver establish connection to MySQL. I have been noticing that when there is inactivity in the application, MySQL would just fade away silently. I am going to monitor this again and see what is the root cause of this.
Just for clarity, this appears to be your connection going away, not the server crashing or shutting down or anything. To make sure of this you can check the Uptime in SHOW GLOBAL STATUS. The time an inactive connection stays in place is controlled by wait_timeout for applications (and interactive_wait_timeout for mysql cmdline client). Does your Ruby environment use persistent connections? Then still it should handle possibly loss of a connection as that can be caused just by general network errors as well - it's transient and not really an error that needs to break things on the front end or otherwise bother a user. Regards, Arjen. -- Arjen Lentz, Exec.Director @ Open Query (http://openquery.com) Exceptional Services for MySQL at a fixed budget. Follow our blog at http://openquery.com/blog/ OurDelta: packages for MySQL and MariaDB @ http://ourdelta.org
Hi Arjen, Can you please explain to me how a persistent connection would affect MySQL to shutdown by itself? I have looked at the Ruby MySQL driver code and there is nothing related to persistent connection. I searched through google and found that persistent connection is only available in PHP MySQL driver. Thank you very much in advance for your time and assistance. Kind regards, Joshua -- http://twitter.com/scrum8 On Thu, Apr 22, 2010 at 4:30 AM, Arjen Lentz <arjen@openquery.com> wrote:
Hi Joshua
On 21/04/2010, at 3:07 AM, Joshua Partogi wrote:
I am getting MySQL server has gone away. I think there is an issue with how the MySQL Ruby driver establish connection to MySQL. I have been noticing that when there is inactivity in the application, MySQL would just fade away silently. I am going to monitor this again and see what is the root cause of this.
Just for clarity, this appears to be your connection going away, not the server crashing or shutting down or anything. To make sure of this you can check the Uptime in SHOW GLOBAL STATUS.
The time an inactive connection stays in place is controlled by wait_timeout for applications (and interactive_wait_timeout for mysql cmdline client). Does your Ruby environment use persistent connections? Then still it should handle possibly loss of a connection as that can be caused just by general network errors as well - it's transient and not really an error that needs to break things on the front end or otherwise bother a user.
Regards, Arjen.
On 4/22/2010 11:23 PM, Joshua Partogi wrote:
Hi Arjen,
Can you please explain to me how a persistent connection would affect MySQL to shutdown by itself? I have looked at the Ruby MySQL driver code and there is nothing related to persistent connection. I searched through google and found that persistent connection is only available in PHP MySQL driver.
Perhaps this [1] web page is related? [1] http://stackoverflow.com/questions/100631/mysql-server-has-gone-away-with-ra...
Hi all, I have come back with my latest findings. It seems MariaDB shutsdown after there is an excessive query running on the server. Is there any parameter that I can tune from MariaDB side for this kind of situation? Kind regards, Joshua On Wed, Apr 21, 2010 at 1:51 PM, Joshua Partogi <jpartogi@scrum8.com> wrote:
Dear all,
I am currently running MariaDB in production and I often found it would shutdown itself silently after inactivity. The application itself is using Ruby on Rails. I have disabled the max_timeout settings in my.cnf but the problem still occurs. Is there anything else I should watch out for to prevent this issue continuing to occur?
Thank you very much for your assistance.
participants (6)
-
Arjen Lentz
-
Bo Thorsen
-
Brian Evans
-
Joshua Partogi
-
Justin Swanhart
-
Walter Heck