<div style="text-align: left;">Hello Kenneth</div><div style="text-align: left;"><br class="webkit-block-placeholder"></div><div style="text-align: left;">Having to "restart" the master on a regular basis!</div><div>
That's quite odd.</div><div><br></div><div>Is this a good scenario ?</div><div><br></div><div>>>>> If your MySQL DB<br>>>>> is not dedicated to PDNS, then you will have to balance the needs<br>
>>>> of all of the applications using the DB. It sounds like you may<br>>>>> be running some pretty poorly written ones. Good luck.<br></div><div><br class="webkit-block-placeholder"></div><div>PDNS has it's own dedicated Mysql server and for the future</div>
<div>i would appreciate if we stick to the subject and not talk nonsense</div><div>about how our running applications are written.</div><div><br class="webkit-block-placeholder"></div><div>Cheers,</div><div><br><div class="gmail_quote">
On Jan 29, 2008 10:27 PM, Kenneth Marshall <<a href="mailto:ktm@rice.edu">ktm@rice.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Stephen,<br>
<br>You are completely correct. It is a bandaid (needed) until the<br>patched version is available. I am in the same situation currently<br>with 2.9.20 and the TCP connection handle problem and have to<br>restart my master on a regular basis. Monitoring is definitely<br>
the way to go for issues such as memory leaks.<br><br>Ken<br><div><div></div><div class="Wj3C7c"><br>On Tue, Jan 29, 2008 at 12:18:54PM -0800, Stephen Manchester wrote:<br>> Increasing the wait_timeout on the mysql server will help, but it does not<br>
> actually solve the memory leak, as dead connections do happen for a number<br>> of reasons (server failure, network failure, stateful firewalls, etc.)<br>><br>> Until a patch can be applied though, increasing the wait_timeout value on<br>
> the MySQL server to something very high (say 1 day or more) is the only<br>> thing you can do.  From what I've read, it looks like the default for MySQL<br>> 4.x was 30s.  The default for 5.x is 28800 seconds, but if there was<br>
> already a my.cnf file laying around (which there often is a 4.x my.cnf file<br>> by default on many distros) then you might inherit this old value which<br>> will cause the problem to happen very often.  Again, this is only a work<br>
> around, not a true fix.  You should still monitor pdns virtual memory usage<br>> from time to time to make sure it isn't getting crazy.<br>><br>> ----- Original Message ----- From: "Kenneth Marshall" <<a href="mailto:ktm@rice.edu">ktm@rice.edu</a>><br>
> To: "Stephen Manchester" <<a href="mailto:smanches@craftyspace.com">smanches@craftyspace.com</a>><br>> Cc: <<a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a>><br>
> Sent: Tuesday, January 29, 2008 11:56 AM<br>> Subject: Re: [Pdns-users] Backend error: Failed to<br>> executemysql_query,perhaps connection died? Err=1: MySQL server has<br>> goneaway<br>><br>><br>>> Again, this problem, for which a patch already exists, is triggered<br>
>> by the DB connection being terminated abnormally by the backend<br>>> server, in this case via a connection time_limit. I do not use<br>>> MySQL as a PDNS backend, but the PostgreSQL backend does correctly<br>
>> reconnect to the database should the connection die. I assume that<br>>> the PDNS will reconnect to the MySQL server when the connection<br>>> dies. It seems that increasing the timeout value in MySQL is that<br>
>> best measure to ensure more robust service from PDNS.<br>>><br>>> Cheers,<br>>> Ken<br>>><br>>><br>>> On Tue, Jan 29, 2008 at 11:43:43AM -0800, Stephen Manchester wrote:<br>>>> There is currently a memory leak in 2.9.21 from gmysql backend threads<br>
>>> dying in this fashion.  The threads themselves are not being cleaned up.<br>>>> this is only noticeable on very light loads where the backends do not get<br>>>> enough traffic to keep the mysql connection open.  You will notice it by<br>
>>> abnormally high virtual memory usage after pdns has been running for a<br>>>> time.  Each backend that dies leaves 10MB of virtual memory allocated<br>>>> (the<br>>>> thread stack?) and this will not get cleaned up until pdns is restarted.<br>
>>><br>>>> Hopefully they will implement mysql connection reconnects in the future,<br>>>> which solves both the memory leak and the backends failing when the<br>>>> connection is closed.  The only solution I found was to apply a patch and<br>
>>> compile from source.<br>>>><br>>>> ----- Original Message ----- From: "Kenneth Marshall" <<a href="mailto:ktm@rice.edu">ktm@rice.edu</a>><br>>>> To: "Catalin Constantin" <<a href="mailto:dazoot@gmail.com">dazoot@gmail.com</a>><br>
>>> Cc: <<a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a>><br>>>> Sent: Tuesday, January 29, 2008 5:25 AM<br>>>> Subject: Re: [Pdns-users] Backend error: Failed to execute<br>
>>> mysql_query,perhaps connection died? Err=1: MySQL server has gone away<br>>>><br>>>><br>>>>> On Tue, Jan 29, 2008 at 03:04:46PM +0200, Catalin Constantin wrote:<br>>>>>> Hello,<br>
>>>>><br>>>>>> This is a funny question.<br>>>>>> Mysql is FINE and it's up and running on localhost.<br>>>>>><br>>>>>> Here is the startup log of PDNS.<br>
>>>>> Jan 29 14:59:05 k2 pdns[30294]: PowerDNS 2.9.20 (C) 2001-2006<br>>>>>> PowerDNS.COMBV (Mar 10 2007, 00:36:58, gcc<br>>>>>> 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) starting up<br>
>>>>> Jan 29 14:59:05 k2 pdns[30294]: PowerDNS comes with ABSOLUTELY NO<br>>>>>> WARRANTY.<br>>>>>> This is free software, and you are welcome to redistribute it according<br>>>>>> to<br>
>>>>> the terms of the GPL version 2.<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Set effective group id to 109<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Set effective user id to 113<br>
>>>>> Jan 29 14:59:05 k2 pdns[30294]: Creating backend connection for TCP<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Master/slave communicator launching<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: gmysql Connection succesful<br>
>>>>> Jan 29 14:59:05 k2 pdns[30294]: gmysql Connection succesful<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: About to create 10 backend threads for<br>>>>>> UDP<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: gmysql Connection succesful<br>
>>>>> Jan 29 14:59:05 k2 pdns[30294]: 14 slave domains need checking<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Domain <a href="http://test1.com" target="_blank">test1.com</a> is stale, master<br>
>>>>> serial<br>>>>>> 1201611548, our serial 1201610827<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Domain <a href="http://test2.com" target="_blank">test2.com</a> is stale, master<br>
>>>>> serial<br>>>>>> 1201611548, our serial 1201610827<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: Domain <a href="http://test3.com" target="_blank">test3.com</a> is stale, master<br>
>>>>> serial<br>>>>>> 1201611548, our serial 1201610827<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: gmysql Connection succesful<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: AXFR started for '<a href="http://test1.com" target="_blank">test1.com</a>',<br>
>>>>> transaction<br>>>>>> started<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: gmysql Connection succesful<br>>>>>> Jan 29 14:59:05 k2 pdns[30294]: AXFR done for '<a href="http://test1.com" target="_blank">test1.com</a>', zone<br>
>>>>> committed<br>>>>>><br>>>>>><br>>>>>> The problem is that mysql closes the connection if there is no<br>>>>>> activity.<br>>>>>> PDNS does not make sure that MySQL is still "alive" and from time to<br>
>>>>> time<br>>>>>> it<br>>>>>> shows in the log errors like:<br>>>>>> Jan 29 11:33:57 k2 pdns[28941]: Backend error: Failed to execute<br>>>>>> mysql_query, perhaps connection died? Err=1: MySQL server has gone away<br>
>>>>><br>>>>>> Does PDNS have a timeout for backend connection "recheck" ?<br>>>>>> Can this be configured ?<br>>>>>><br>>>>>> Is there anything we can do to make sure the connection does not go<br>
>>>>> away<br>>>>>> ?<br>>>>>><br>>>>>> Note: the NS server activity for now is not much (we're still testing<br>>>>>> and<br>>>>>> just have a couple of domains on it).<br>
>>>>><br>>>>>> Thanks,<br>>>>>><br>>>>> Dear Ms. Constantin,<br>>>>><br>>>>> If a properly functioning application opens a connection to a database,<br>
>>>> the connection should not drop until closed. The typical fix is to<br>>>>> increase your timeout on your MySQL server appropriately. This same<br>>>>> thread comes up periodically. In order for PDNS to notice that a<br>
>>>> connection has died, it tries to use it with a query. This causes<br>>>>> the errors in your logs. The amount of errors will be proportional<br>>>>> to how long your timeout is set. I certainly would not like to see<br>
>>>> a patch that added overhead to every query to check the status of<br>>>>> a connection and re-establish if needed. PDNS will re-connect if<br>>>>> the connection drops, but you will get an error. If your MySQL DB<br>
>>>> is not dedicated to PDNS, then you will have to balance the needs<br>>>>> of all of the applications using the DB. It sounds like you may<br>>>>> be running some pretty poorly written ones. Good luck.<br>
>>>><br>>>>> Ken<br>>>>><br>>>>>> On 1/29/08, Nico van Royen <<a href="mailto:nico@van-royen.nl">nico@van-royen.nl</a>> wrote:<br>>>>>> > Hello,<br>
>>>>> ><br>>>>>> > Do you infact have a running mysql server ?  Also check the database<br>>>>>> >  ><br>>>>>> that<br>>>>>> > you have specified in your pdns.conf matches your actual database<br>
>>>>> > information (db name, user/password etc).<br>>>>>> ><br>>>>>> > Regards,<br>>>>>> > Nico<br>>>>>> > <a href="http://WARP3.COM" target="_blank">WARP3.COM</a><br>
>>>>> > ________________________________<br>>>>>> > From: Catalin Constantin [mailto:<a href="mailto:dazoot@gmail.com">dazoot@gmail.com</a>]<br>>>>>> > To: <a href="mailto:pdns-users@mailman.powerdns.com">pdns-users@mailman.powerdns.com</a><br>
>>>>> > Sent: Tue, 29 Jan 2008 10:48:09 +0100<br>>>>>> > Subject: [Pdns-users] Backend error: Failed to execute mysql_query,<br>>>>>> perhaps<br>>>>>> > connection died? Err=1: MySQL server has gone away<br>
>>>>> ><br>>>>>> ><br>>>>>> > Hello,<br>>>>>> ><br>>>>>> > We're getting quite many errors:<br>>>>>> > Backend error: Failed to execute mysql_query, perhaps connection ><br>
>>>>> died?<br>>>>>> > Err=1: MySQL server has gone away latelly.<br>>>>>> ><br>>>>>> > I checked the docs and the mailing lists for this error and i found<br>
>>>>> > little informations about it.<br>>>>>> ><br>>>>>> > What is actually the solution for this error not to happen ?<br>>>>>> > Nice would be to have a real example.<br>
>>>>> ><br>>>>>> > Note:<br>>>>>> > - we use latest pdns package from Debian Etch (stable).<br>>>>>> ><br>>>>>> > Thanks,<br>>>>>> ><br>
>>>>> > --<br>>>>>> > Catalin Constantin<br>>>>>> > Dazoot Software<br>>>>>> > <a href="http://www.dazoot.eu/" target="_blank">http://www.dazoot.eu/</a><br>
>>>>> > _______________________________________________<br>>>>>> > Pdns-users mailing list<br>>>>>> > <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>
>>>>> > <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>>>>>> ><br>>>>>> > _______________________________________________<br>
>>>>> > Pdns-users mailing list<br>>>>>> > <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>>>>>> > <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
>>>>> ><br>>>>>> ><br>>>>>><br>>>>>><br>>>>>> --<br>>>>>> Catalin Constantin<br>>>>>> Dazoot Software<br>>>>>> <a href="http://www.dazoot.eu/" target="_blank">http://www.dazoot.eu/</a><br>
>>>><br>>>>>> _______________________________________________<br>>>>>> Pdns-users mailing list<br>>>>>> <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>
>>>>> <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>>>>><br>>>>> _______________________________________________<br>
>>>> Pdns-users mailing list<br>>>>> <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>>>>> <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
>>><br>>>> _______________________________________________<br>>>> Pdns-users mailing list<br>>>> <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>
>>> <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>>>><br>><br>> _______________________________________________<br>
> Pdns-users mailing list<br>> <a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br>> <a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
><br>_______________________________________________<br>Pdns-users mailing list<br><a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a><br><a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Catalin Constantin<br>Dazoot Software<br><a href="http://www.dazoot.eu/">http://www.dazoot.eu/</a>
</div>