<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I’m experimenting with Galera in my Rocky openstack-ansible dev cluster, and I’m finding that the default haproxy config values don’t seem to work. Finding the correct values is a lot of work. For example, I spent this morning experimenting
 with different values for “timeout  client” in /etc/haproxy/haproxy.cfg. The default is 1m, and with the default set I see this error in /var/log/nova/nova-scheduler.log on the controllers:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">2020-01-17 13:54:26.059 443358 ERROR oslo_db.sqlalchemy.engines DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: u'SELECT 1'] (Background on this error at: http://sqlalche.me/e/e3q8)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There are several timeout values in /etc/haproxy/haproxy.cfg. These are the values we started with:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">stats timeout 30s<o:p></o:p></p>
<p class="MsoNormal">timeout  http-request 10s<o:p></o:p></p>
<p class="MsoNormal">timeout  queue 1m<o:p></o:p></p>
<p class="MsoNormal">timeout  connect 10s<o:p></o:p></p>
<p class="MsoNormal">timeout  client 1m<o:p></o:p></p>
<p class="MsoNormal">timeout  server 1m<o:p></o:p></p>
<p class="MsoNormal">timeout  check 10s<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">At first I changed them all to 30m. This stopped the “Lost connection” error in nova-scheduler.log. Then, one at a time, I changed them back to the default. When I got to “timeout  client” I found that setting it back to 1m caused the errors
 to start again. I changed it back and forth and found that 4 minutes causes errors, and 6m stops them, so I left it at 6m.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">These are my active variables:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">root@us01odc-dev2-ctrl1:/etc/mysql# mysql -e 'show variables;'|grep timeout<o:p></o:p></p>
<p class="MsoNormal">connect_timeout 20<o:p></o:p></p>
<p class="MsoNormal">deadlock_timeout_long   50000000<o:p></o:p></p>
<p class="MsoNormal">deadlock_timeout_short  10000<o:p></o:p></p>
<p class="MsoNormal">delayed_insert_timeout  300<o:p></o:p></p>
<p class="MsoNormal">idle_readonly_transaction_timeout       0<o:p></o:p></p>
<p class="MsoNormal">idle_transaction_timeout        0<o:p></o:p></p>
<p class="MsoNormal">idle_write_transaction_timeout  0<o:p></o:p></p>
<p class="MsoNormal">innodb_flush_log_at_timeout     1<o:p></o:p></p>
<p class="MsoNormal">innodb_lock_wait_timeout        50<o:p></o:p></p>
<p class="MsoNormal">innodb_rollback_on_timeout      OFF<o:p></o:p></p>
<p class="MsoNormal">interactive_timeout     28800<o:p></o:p></p>
<p class="MsoNormal">lock_wait_timeout       86400<o:p></o:p></p>
<p class="MsoNormal">net_read_timeout        30<o:p></o:p></p>
<p class="MsoNormal">net_write_timeout       60<o:p></o:p></p>
<p class="MsoNormal">rpl_semi_sync_master_timeout    10000<o:p></o:p></p>
<p class="MsoNormal">rpl_semi_sync_slave_kill_conn_timeout   5<o:p></o:p></p>
<p class="MsoNormal">slave_net_timeout       60<o:p></o:p></p>
<p class="MsoNormal">thread_pool_idle_timeout        60<o:p></o:p></p>
<p class="MsoNormal">wait_timeout    3600<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So it looks like the value of “timeout  client” in haproxy.cfg needs to match or exceed the value of “wait_timeout” in mysql. Also in nova.conf I see “#connection_recycle_time = 3600” – I need to experiment to see how that value interacts
 with the timeouts in the other config files.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this the best way to find the correct config values? It seems like there should be a document that talks about these timeouts and how to set them (or maybe more generally how the different timeout settings in the various config files
 interact). Does that document exist? If not, maybe I could write one, since I have to figure out the correct values anyway.<o:p></o:p></p>
</div>
</body>
</html>