Update docs to highlight that the auditor chunk size can be set
May not be obvious, but existing code will let you change the disk_chunk_size just for the auditor so this just points that out in the docs. In one short test I ran with a 4 node cluster with 18GB of 4MB objects on it, changint he auditor chunk size from the default of 64K to 1MB creased the auditor CPU time from 10% to 4%. Also added test code to make sure this overridden value is actually used and checked other auditWorker conf values as well. Change-Id: Ia12e1c6127877dc2124b60cd963cd0b6d5f3d6ef
This commit is contained in:
@@ -520,6 +520,7 @@ log_name object-auditor Label used when logging
|
||||
log_facility LOG_LOCAL0 Syslog log facility
|
||||
log_level INFO Logging level
|
||||
log_time 3600 Frequency of status logs in seconds.
|
||||
disk_chunk_size 65536 Size of chunks read during auditing
|
||||
files_per_second 20 Maximum files audited per second per
|
||||
auditor process. Should be tuned according
|
||||
to individual system specs. 0 is unlimited.
|
||||
|
||||
@@ -226,6 +226,9 @@ use = egg:swift#recon
|
||||
# log_level = INFO
|
||||
# log_address = /dev/log
|
||||
#
|
||||
# You can set the disk chunk size that the auditor uses making it larger if
|
||||
# you like for more efficient local auditing of larger objects
|
||||
# disk_chunk_size = 65536
|
||||
# files_per_second = 20
|
||||
# concurrency = 1
|
||||
# bytes_per_second = 10000000
|
||||
|
||||
@@ -78,6 +78,33 @@ class TestAuditor(unittest.TestCase):
|
||||
rmtree(os.path.dirname(self.testdir), ignore_errors=1)
|
||||
unit.xattr_data = {}
|
||||
|
||||
def test_worker_conf_parms(self):
|
||||
def check_common_defaults():
|
||||
self.assertEquals(auditor_worker.max_bytes_per_second, 10000000)
|
||||
self.assertEquals(auditor_worker.log_time, 3600)
|
||||
|
||||
# test default values
|
||||
conf = dict(
|
||||
devices=self.devices,
|
||||
mount_check='false',
|
||||
object_size_stats='10,100,1024,10240')
|
||||
auditor_worker = auditor.AuditorWorker(conf, self.logger,
|
||||
self.rcache, self.devices)
|
||||
check_common_defaults()
|
||||
self.assertEquals(auditor_worker.diskfile_mgr.disk_chunk_size, 65536)
|
||||
self.assertEquals(auditor_worker.max_files_per_second, 20)
|
||||
self.assertEquals(auditor_worker.zero_byte_only_at_fps, 0)
|
||||
|
||||
# test specified audit value overrides
|
||||
conf.update({'disk_chunk_size': 4096})
|
||||
auditor_worker = auditor.AuditorWorker(conf, self.logger,
|
||||
self.rcache, self.devices,
|
||||
zero_byte_only_at_fps=50)
|
||||
check_common_defaults()
|
||||
self.assertEquals(auditor_worker.diskfile_mgr.disk_chunk_size, 4096)
|
||||
self.assertEquals(auditor_worker.max_files_per_second, 50)
|
||||
self.assertEquals(auditor_worker.zero_byte_only_at_fps, 50)
|
||||
|
||||
def test_object_audit_extra_data(self):
|
||||
def run_tests(disk_file):
|
||||
auditor_worker = auditor.AuditorWorker(self.conf, self.logger,
|
||||
|
||||
Reference in New Issue
Block a user