summaryrefslogtreecommitdiff
path: root/ctdb/doc/ctdb-tunables.7.xml
blob: b029fdb75a89ed496b22d8f939c09833ff0ffc95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry
	PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
	"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">

<refentry id="ctdb-tunables.7">

  <refmeta>
    <refentrytitle>ctdb-tunables</refentrytitle>
    <manvolnum>7</manvolnum>
    <refmiscinfo class="source">ctdb</refmiscinfo>
    <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>ctdb-tunables</refname>
    <refpurpose>CTDB tunable configuration variables</refpurpose>
  </refnamediv>

  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      CTDB's behaviour can be configured by setting run-time tunable
      variables.  This lists and describes all tunables.  See the
      <citerefentry><refentrytitle>ctdb</refentrytitle>
      <manvolnum>1</manvolnum></citerefentry>
      <command>listvars</command>, <command>setvar</command> and
      <command>getvar</command> commands for more details.
    </para>

    <refsect2>
      <title>MaxRedirectCount</title>
      <para>Default: 3</para>
      <para>
	If we are not the DMASTER and need to fetch a record across the network
	we first send the request to the LMASTER after which the record
	is passed onto the current DMASTER. If the DMASTER changes before
	the request has reached that node, the request will be passed onto the
	"next" DMASTER. For very hot records that migrate rapidly across the
	cluster this can cause a request to "chase" the record for many hops
	before it catches up with the record.

	this is how many hops we allow trying to chase the DMASTER before we
	switch back to the LMASTER again to ask for new directions.
      </para>
      <para>
	When chasing a record, this is how many hops we will chase the record
	for before going back to the LMASTER to ask for new guidance.
      </para>
    </refsect2>

    <refsect2>
      <title>SeqnumInterval</title>
      <para>Default: 1000</para>
      <para>
	Some databases have seqnum tracking enabled, so that samba will be able
	to detect asynchronously when there has been updates to the database.
	Everytime a database is updated its sequence number is increased.
      </para>
      <para>
	This tunable is used to specify in 'ms' how frequently ctdb will
	send out updates to remote nodes to inform them that the sequence
	number is increased.
      </para>
    </refsect2>

    <refsect2>
      <title>ControlTimeout</title>
      <para>Default: 60</para>
      <para>
	This is the default
	setting for timeout for when sending a control message to either the
	local or a remote ctdb daemon.
      </para>
    </refsect2>

    <refsect2>
      <title>TraverseTimeout</title>
      <para>Default: 20</para>
      <para>
	This setting controls how long we allow a traverse process to run.
	After this timeout triggers, the main ctdb daemon will abort the
	traverse if it has not yet finished.
      </para>
    </refsect2>

    <refsect2>
      <title>KeepaliveInterval</title>
      <para>Default: 5</para>
      <para>
	How often in seconds should the nodes send keepalives to eachother.
      </para>
    </refsect2>

    <refsect2>
      <title>KeepaliveLimit</title>
      <para>Default: 5</para>
      <para>
	After how many keepalive intervals without any traffic should a node
	wait until marking the peer as DISCONNECTED.
      </para>
      <para>
	If a node has hung, it can thus take KeepaliveInterval*(KeepaliveLimit+1)
	seconds before we determine that the node is DISCONNECTED and that we
	require a recovery. This limitshould not be set too high since we want
	a hung node to be detectec, and expunged from the cluster well before
	common CIFS timeouts (45-90 seconds) kick in.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoverTimeout</title>
      <para>Default: 20</para>
      <para>
	This is the default setting for timeouts for controls when sent from the
	recovery daemon. We allow longer control timeouts from the recovery daemon
	than from normal use since the recovery dameon often use controls that 
	can take a lot longer than normal controls.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoverInterval</title>
      <para>Default: 1</para>
      <para>
	How frequently in seconds should the recovery daemon perform the
	consistency checks that determine if we need to perform a recovery or not.
      </para>
    </refsect2>

    <refsect2>
      <title>ElectionTimeout</title>
      <para>Default: 3</para>
      <para>
	When electing a new recovery master, this is how many seconds we allow
	the election to take before we either deem the election finished
	or we fail the election and start a new one.
      </para>
    </refsect2>

    <refsect2>
      <title>TakeoverTimeout</title>
      <para>Default: 9</para>
      <para>
	This is how many seconds we allow controls to take for IP failover events.
      </para>
    </refsect2>

    <refsect2>
      <title>MonitorInterval</title>
      <para>Default: 15</para>
      <para>
	How often should ctdb run the event scripts to check for a nodes health.
      </para>
    </refsect2>

    <refsect2>
      <title>TickleUpdateInterval</title>
      <para>Default: 20</para>
      <para>
	How often will ctdb record and store the "tickle" information used to
	kickstart stalled tcp connections after a recovery.
      </para>
    </refsect2>

    <refsect2>
      <title>EventScriptTimeout</title>
      <para>Default: 20</para>
      <para>
	How long should ctdb let an event script run before aborting it and
	marking the node unhealthy.
      </para>
    </refsect2>

    <refsect2>
      <title>EventScriptTimeoutCount</title>
      <para>Default: 1</para>
      <para>
	How many events in a row needs to timeout before we flag the node UNHEALTHY.
	This setting is useful if your scripts can not be written so that they
	do not hang for benign reasons.
      </para>
    </refsect2>

    <refsect2>
      <title>EventScriptUnhealthyOnTimeout</title>
      <para>Default: 0</para>
      <para>
	This setting can be be used to make ctdb never become UNHEALTHY if your
	eventscripts keep hanging/timing out.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoveryGracePeriod</title>
      <para>Default: 120</para>
      <para>
	During recoveries, if a node has not caused recovery failures during the
	last grace period, any records of transgressions that the node has caused
	recovery failures will be forgiven. This resets the ban-counter back to 
	zero for that node.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoveryBanPeriod</title>
      <para>Default: 300</para>
      <para>
	If a node becomes banned causing repetitive recovery failures. The node will
	eventually become banned from the cluster.
	This controls how long the culprit node will be banned from the cluster
	before it is allowed to try to join the cluster again.
	Don't set to small. A node gets banned for a reason and it is usually due
	to real problems with the node.
      </para>
    </refsect2>

    <refsect2>
      <title>DatabaseHashSize</title>
      <para>Default: 100001</para>
      <para>
	Size of the hash chains for the local store of the tdbs that ctdb manages.
      </para>
    </refsect2>

    <refsect2>
      <title>DatabaseMaxDead</title>
      <para>Default: 5</para>
      <para>
	How many dead records per hashchain in the TDB database do we allow before
	the freelist needs to be processed.
      </para>
    </refsect2>

    <refsect2>
      <title>RerecoveryTimeout</title>
      <para>Default: 10</para>
      <para>
	Once a recovery has completed, no additional recoveries are permitted
	until this timeout has expired.
      </para>
    </refsect2>

    <refsect2>
      <title>EnableBans</title>
      <para>Default: 1</para>
      <para>
	When set to 0, this disables BANNING completely in the cluster and thus
	nodes can not get banned, even it they break. Don't set to 0 unless you
	know what you are doing.  You should set this to the same value on
	all nodes to avoid unexpected behaviour.
      </para>
    </refsect2>

    <refsect2>
      <title>DeterministicIPs</title>
      <para>Default: 0</para>
      <para>
	When enabled, this tunable makes ctdb try to keep public IP addresses
	locked to specific nodes as far as possible. This makes it easier for
	debugging since you can know that as long as all nodes are healthy
	public IP X will always be hosted by node Y. 
      </para>
      <para>
	The cost of using deterministic IP address assignment is that it
	disables part of the logic where ctdb tries to reduce the number of
	public IP assignment changes in the cluster. This tunable may increase
	the number of IP failover/failbacks that are performed on the cluster
	by a small margin.
      </para>

    </refsect2>
    <refsect2>
      <title>LCP2PublicIPs</title>
      <para>Default: 1</para>
      <para>
	When enabled this switches ctdb to use the LCP2 ip allocation
	algorithm.
      </para>
    </refsect2>

    <refsect2>
      <title>ReclockPingPeriod</title>
      <para>Default: x</para>
      <para>
	Obsolete
      </para>
    </refsect2>

    <refsect2>
      <title>NoIPFailback</title>
      <para>Default: 0</para>
      <para>
	When set to 1, ctdb will not perform failback of IP addresses when a node
	becomes healthy. Ctdb WILL perform failover of public IP addresses when a
	node becomes UNHEALTHY, but when the node becomes HEALTHY again, ctdb
	will not fail the addresses back.
      </para>
      <para>
	Use with caution! Normally when a node becomes available to the cluster
	ctdb will try to reassign public IP addresses onto the new node as a way
	to distribute the workload evenly across the clusternode. Ctdb tries to
	make sure that all running nodes have approximately the same number of
	public addresses it hosts.
      </para>
      <para>
	When you enable this tunable, CTDB will no longer attempt to rebalance
	the cluster by failing IP addresses back to the new nodes. An unbalanced
	cluster will therefore remain unbalanced until there is manual
	intervention from the administrator. When this parameter is set, you can
	manually fail public IP addresses over to the new node(s) using the
	'ctdb moveip' command.
      </para>
    </refsect2>

    <refsect2>
      <title>DisableIPFailover</title>
      <para>Default: 0</para>
      <para>
	When enabled, ctdb will not perform failover or failback. Even if a
	node fails while holding public IPs, ctdb will not recover the IPs or
	assign them to another node.
      </para>
      <para>
	When you enable this tunable, CTDB will no longer attempt to recover
	the cluster by failing IP addresses over to other nodes. This leads to
	a service outage until the administrator has manually performed failover
	to replacement nodes using the 'ctdb moveip' command.
      </para>
    </refsect2>

    <refsect2>
      <title>NoIPTakeover</title>
      <para>Default: 0</para>
      <para>
	When set to 1, ctdb will not allow IP addresses to be failed over
	onto this node. Any IP addresses that the node currently hosts
	will remain on the node but no new IP addresses can be failed over
	to the node.
      </para>
    </refsect2>

    <refsect2>
      <title>NoIPHostOnAllDisabled</title>
      <para>Default: 0</para>
      <para>
	If no nodes are healthy then by default ctdb will happily host
	public IPs on disabled (unhealthy or administratively disabled)
	nodes.  This can cause problems, for example if the underlying
	cluster filesystem is not mounted.  When set to 1 on a node and
	that node is disabled it, any IPs hosted by this node will be
	released and the node will not takeover any IPs until it is no
	longer disabled.
      </para>
    </refsect2>

    <refsect2>
      <title>DBRecordCountWarn</title>
      <para>Default: 100000</para>
      <para>
	When set to non-zero, ctdb will log a warning when we try to recover a
	database with more than this many records. This will produce a warning
	if a database grows uncontrollably with orphaned records.
      </para>
    </refsect2>

    <refsect2>
      <title>DBRecordSizeWarn</title>
      <para>Default: 10000000</para>
      <para>
	When set to non-zero, ctdb will log a warning when we try to recover a
	database where a single record is bigger than this. This will produce
	a warning if a database record grows uncontrollably with orphaned
	sub-records.
      </para>
    </refsect2>

    <refsect2>
      <title>DBSizeWarn</title>
      <para>Default: 1000000000</para>
      <para>
	When set to non-zero, ctdb will log a warning when we try to recover a
	database bigger than this. This will produce
	a warning if a database grows uncontrollably.
      </para>
    </refsect2>

    <refsect2>
      <title>VerboseMemoryNames</title>
      <para>Default: 0</para>
      <para>
	This feature consumes additional memory. when used the talloc library
	will create more verbose names for all talloc allocated objects.
      </para>
    </refsect2>

    <refsect2>
      <title>RecdPingTimeout</title>
      <para>Default: 60</para>
      <para>
	If the main dameon has not heard a "ping" from the recovery dameon for
	this many seconds, the main dameon will log a message that the recovery
	daemon is potentially hung.
      </para>
    </refsect2>

    <refsect2>
      <title>RecdFailCount</title>
      <para>Default: 10</para>
      <para>
	If the recovery daemon has failed to ping the main dameon for this many
	consecutive intervals, the main daemon will consider the recovery daemon
	as hung and will try to restart it to recover.
      </para>
    </refsect2>

    <refsect2>
      <title>LogLatencyMs</title>
      <para>Default: 0</para>
      <para>
	When set to non-zero, this will make the main daemon log any operation that
	took longer than this value, in 'ms', to complete.
	These include "how long time a lockwait child process needed", 
	"how long time to write to a persistent database" but also
	"how long did it take to get a response to a CALL from a remote node".
      </para>
    </refsect2>

    <refsect2>
      <title>RecLockLatencyMs</title>
      <para>Default: 1000</para>
      <para>
	When using a reclock file for split brain prevention, if set to non-zero
	this tunable will make the recovery dameon log a message if the fcntl()
	call to lock/testlock the recovery file takes longer than this number of 
	ms.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoveryDropAllIPs</title>
      <para>Default: 120</para>
      <para>
	If we have been stuck in recovery, or stopped, or banned, mode for
	this many seconds we will force drop all held public addresses.
      </para>
    </refsect2>

    <refsect2>
      <title>VacuumInterval</title>
      <para>Default: 10</para>
      <para>
        Periodic interval in seconds when vacuuming is triggered for
        volatile databases.
      </para>
    </refsect2>

    <refsect2>
      <title>VacuumMaxRunTime</title>
      <para>Default: 120</para>
      <para>
        The maximum time in seconds for which the vacuuming process is
        allowed to run.  If vacuuming process takes longer than this
        value, then the vacuuming process is terminated.
      </para>
    </refsect2>

    <refsect2>
      <title>RepackLimit</title>
      <para>Default: 10000</para>
      <para>
        During vacuuming, if the number of freelist records are more
        than <varname>RepackLimit</varname>, then databases are
        repacked to get rid of the freelist records to avoid
        fragmentation.
      </para>
      <para>
        Databases are repacked only if both
        <varname>RepackLimit</varname> and
        <varname>VacuumLimit</varname> are exceeded.
      </para>
    </refsect2>

    <refsect2>
      <title>VacuumLimit</title>
      <para>Default: 5000</para>
      <para>
        During vacuuming, if the number of deleted records are more
        than <varname>VacuumLimit</varname>, then databases are
        repacked to avoid fragmentation.
      </para>
      <para>
        Databases are repacked only if both
        <varname>RepackLimit</varname> and
        <varname>VacuumLimit</varname> are exceeded.
      </para>
    </refsect2>

    <refsect2>
      <title>VacuumFastPathCount</title>
      <para>Default: 60</para>
      <para>
        When a record is deleted, it is marked for deletion during
        vacuuming.  Vacuuming process usually processes this list to purge
        the records from the database.  If the number of records marked
        for deletion are more than VacuumFastPathCount, then vacuuming
	process will scan the complete database for empty records instead
	of using the list of records marked for deletion.
      </para>
    </refsect2>

    <refsect2>
      <title>DeferredAttachTO</title>
      <para>Default: 120</para>
      <para>
	When databases are frozen we do not allow clients to attach to the
	databases. Instead of returning an error immediately to the application
	the attach request from the client is deferred until the database
	becomes available again at which stage we respond to the client.
      </para>
      <para>
	This timeout controls how long we will defer the request from the client
	before timing it out and returning an error to the client.
      </para>
    </refsect2>

    <refsect2>
      <title>HopcountMakeSticky</title>
      <para>Default: 50</para>
      <para>
	If the database is set to 'STICKY' mode, using the 'ctdb setdbsticky' 
	command, any record that is seen as very hot and migrating so fast that
	hopcount surpasses 50 is set to become a STICKY record for StickyDuration
	seconds. This means that after each migration the record will be kept on
	the node and prevented from being migrated off the node.
      </para>
      <para>
	This setting allows one to try to identify such records and stop them from
	migrating across the cluster so fast. This will improve performance for
	certain workloads, such as locking.tdb if many clients are opening/closing
	the same file concurrently.
      </para>
    </refsect2>

    <refsect2>
      <title>StickyDuration</title>
      <para>Default: 600</para>
      <para>
	Once a record has been found to be fetch-lock hot and has been flagged to
	become STICKY, this is for how long, in seconds, the record will be 
	flagged as a STICKY record.
      </para>
    </refsect2>

    <refsect2>
      <title>StickyPindown</title>
      <para>Default: 200</para>
      <para>
	Once a STICKY record has been migrated onto a node, it will be pinned down
	on that node for this number of ms. Any request from other nodes to migrate
	the record off the node will be deferred until the pindown timer expires.
      </para>
    </refsect2>

    <refsect2>
      <title>StatHistoryInterval</title>
      <para>Default: 1</para>
      <para>
	Granularity of the statistics collected in the statistics history.
      </para>
    </refsect2>

    <refsect2>
      <title>AllowClientDBAttach</title>
      <para>Default: 1</para>
      <para>
	When set to 0, clients are not allowed to attach to any databases.
	This can be used to temporarily block any new processes from attaching
	to and accessing the databases.
      </para>
    </refsect2>

    <refsect2>
      <title>RecoverPDBBySeqNum</title>
      <para>Default: 1</para>
      <para>
	When set to zero, database recovery for persistent databases
	is record-by-record and recovery process simply collects the
	most recent version of every individual record.
      </para>
      <para>
	When set to non-zero, persistent databases will instead be
	recovered as a whole db and not by individual records. The
	node that contains the highest value stored in the record
	"__db_sequence_number__" is selected and the copy of that
	nodes database is used as the recovered database.
      </para>
      <para>
	By default, recovery of persistent databses is done using
	__db_sequence_number__ record.
      </para>
    </refsect2>

    <refsect2>
      <title>FetchCollapse</title>
      <para>Default: 1</para>
      <para>
	When many clients across many nodes try to access the same record at the
	same time this can lead to a fetch storm where the record becomes very
	active and bounces between nodes very fast. This leads to high CPU
	utilization of the ctdbd daemon, trying to bounce that record around
	very fast, and poor performance.
      </para>
      <para>
	This parameter is used to activate a fetch-collapse. A fetch-collapse
	is when we track which records we have requests in flight so that we only
	keep one request in flight from a certain node, even if multiple smbd
	processes are attemtping to fetch the record at the same time. This 
	can improve performance and reduce CPU utilization for certain
	workloads.
      </para>
      <para>
	This timeout controls if we should collapse multiple fetch operations
	of the same record into a single request and defer all duplicates or not.
      </para>
    </refsect2>

    <refsect2>
      <title>Samba3AvoidDeadlocks</title>
      <para>Default: 0</para>
      <para>
	Enable code that prevents deadlocks with Samba (only for Samba 3.x).
      </para>
      <para>
	This should be set to 1 when using Samba version 3.x to enable special
	code in CTDB to avoid deadlock with Samba version 3.x.  This code
	is not required for Samba version 4.x and must not be enabled for
	Samba 4.x.
      </para>
    </refsect2>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <citerefentry><refentrytitle>ctdb</refentrytitle>
      <manvolnum>1</manvolnum></citerefentry>,

      <citerefentry><refentrytitle>ctdbd</refentrytitle>
      <manvolnum>1</manvolnum></citerefentry>,

      <citerefentry><refentrytitle>ctdbd.conf</refentrytitle>
      <manvolnum>5</manvolnum></citerefentry>,

      <citerefentry><refentrytitle>ctdb</refentrytitle>
      <manvolnum>7</manvolnum></citerefentry>,

      <ulink url="http://ctdb.samba.org/"/>
    </para>
  </refsect1>

  <refentryinfo>
    <author>
      <contrib>
	This documentation was written by
	Ronnie Sahlberg,
	Amitay Isaacs,
	Martin Schwenke
      </contrib>
    </author>

    <copyright>
      <year>2007</year>
      <holder>Andrew Tridgell</holder>
      <holder>Ronnie Sahlberg</holder>
    </copyright>
    <legalnotice>
      <para>
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License as
	published by the Free Software Foundation; either version 3 of
	the License, or (at your option) any later version.
      </para>
      <para>
	This program is distributed in the hope that it will be
	useful, but WITHOUT ANY WARRANTY; without even the implied
	warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
	PURPOSE.  See the GNU General Public License for more details.
      </para>
      <para>
	You should have received a copy of the GNU General Public
	License along with this program; if not, see
	<ulink url="http://www.gnu.org/licenses"/>.
      </para>
    </legalnotice>
  </refentryinfo>

</refentry>