@@ -72,9 +72,12 @@ def main():
|
|||||||
parser.print_help()
|
parser.print_help()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
concurrency = int(utils.get_config('filler', 'concurrency'))
|
sw_c_concu = int(utils.get_config('filler',
|
||||||
pile = eventlet.GreenPile(concurrency)
|
'swift_client_concurrency'))
|
||||||
pool = eventlet.GreenPool(concurrency)
|
ks_c_concu = int(utils.get_config('filler',
|
||||||
|
'keystone_client_concurrency'))
|
||||||
|
pile = eventlet.GreenPile(sw_c_concu)
|
||||||
|
pool = eventlet.GreenPool(ks_c_concu)
|
||||||
|
|
||||||
_config = utils.get_config('auth',
|
_config = utils.get_config('auth',
|
||||||
'keystone_origin_admin_credentials').split(':')
|
'keystone_origin_admin_credentials').split(':')
|
||||||
|
|||||||
@@ -8,14 +8,18 @@ keystone_origin_demo_credentials = demo:demo:ADMIN
|
|||||||
keystone_dest_credentials = demo:demo:ADMIN
|
keystone_dest_credentials = demo:demo:ADMIN
|
||||||
|
|
||||||
[sync]
|
[sync]
|
||||||
# This is usually bound to the max open files.
|
|
||||||
max_gthreads = 10
|
|
||||||
|
|
||||||
[filler]
|
[filler]
|
||||||
swift_operator_role = Member
|
swift_operator_role = Member
|
||||||
concurrency = 1
|
|
||||||
|
|
||||||
default_user_password = password
|
default_user_password = password
|
||||||
default_user_email = johndoe@domain.com
|
default_user_email = johndoe@domain.com
|
||||||
|
|
||||||
index_path = /tmp/swift_filler_index.pkl
|
index_path = /tmp/swift_filler_index.pkl
|
||||||
index_containers_path = /tmp/swift_filler_containers_index.pkl
|
index_containers_path = /tmp/swift_filler_containers_index.pkl
|
||||||
|
|
||||||
|
[concurrency]
|
||||||
|
keystone_client_concurrency = 5
|
||||||
|
swift_client_concurrency = 10
|
||||||
|
# This is usually bound to the max open files.
|
||||||
|
sync_swift_client_concurrency = 10
|
||||||
|
|||||||
@@ -26,8 +26,9 @@ import swsync.utils
|
|||||||
class Containers(object):
|
class Containers(object):
|
||||||
"""Containers sync."""
|
"""Containers sync."""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.max_gthreads = int(swsync.utils.get_config("sync",
|
self.concurrency = int(swsync.utils.get_config(
|
||||||
"max_gthreads"))
|
"concurrency",
|
||||||
|
"sync_swift_client_concurrency"))
|
||||||
self.sync_object = swsync.objects.sync_object
|
self.sync_object = swsync.objects.sync_object
|
||||||
self.delete_object = swsync.objects.delete_object
|
self.delete_object = swsync.objects.delete_object
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ class Containers(object):
|
|||||||
set2 = set((x['name']) for x in dest_containers)
|
set2 = set((x['name']) for x in dest_containers)
|
||||||
delete_diff = set2 - set1
|
delete_diff = set2 - set1
|
||||||
|
|
||||||
pool = eventlet.GreenPool(size=self.max_gthreads)
|
pool = eventlet.GreenPool(size=self.concurrency)
|
||||||
pile = eventlet.GreenPile(pool)
|
pile = eventlet.GreenPile(pool)
|
||||||
for container in delete_diff:
|
for container in delete_diff:
|
||||||
try:
|
try:
|
||||||
@@ -115,7 +116,7 @@ class Containers(object):
|
|||||||
if not diff and not delete_diff:
|
if not diff and not delete_diff:
|
||||||
return
|
return
|
||||||
|
|
||||||
pool = eventlet.GreenPool(size=self.max_gthreads)
|
pool = eventlet.GreenPool(size=self.concurrency)
|
||||||
pile = eventlet.GreenPile(pool)
|
pile = eventlet.GreenPile(pool)
|
||||||
|
|
||||||
for obj in diff:
|
for obj in diff:
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ class TestFiller(base.TestCase):
|
|||||||
self.stubs.Set(filler, 'create_objects', create_objects)
|
self.stubs.Set(filler, 'create_objects', create_objects)
|
||||||
self.stubs.Set(filler, 'create_containers', create_containers)
|
self.stubs.Set(filler, 'create_containers', create_containers)
|
||||||
|
|
||||||
concurrency = int(utils.get_config('filler', 'concurrency'))
|
concurrency = int(utils.get_config('concurrency',
|
||||||
|
'swift_client_concurrency'))
|
||||||
pool = eventlet.GreenPool(concurrency)
|
pool = eventlet.GreenPool(concurrency)
|
||||||
|
|
||||||
created = {('account1', 'account1_id'): ['test', 'test_id', 'role_id'],
|
created = {('account1', 'account1_id'): ['test', 'test_id', 'role_id'],
|
||||||
@@ -202,7 +203,8 @@ class TestFiller(base.TestCase):
|
|||||||
|
|
||||||
self.stubs.Set(filler, 'create_swift_user', create_swift_user)
|
self.stubs.Set(filler, 'create_swift_user', create_swift_user)
|
||||||
|
|
||||||
concurrency = int(utils.get_config('filler', 'concurrency'))
|
concurrency = int(utils.get_config('concurrency',
|
||||||
|
'keystone_client_concurrency'))
|
||||||
pile = eventlet.GreenPile(concurrency)
|
pile = eventlet.GreenPile(concurrency)
|
||||||
client = FakeKSClient()
|
client = FakeKSClient()
|
||||||
filler.create_swift_account(client, pile, 1, 1, self.ret_index)
|
filler.create_swift_account(client, pile, 1, 1, self.ret_index)
|
||||||
@@ -230,7 +232,8 @@ class TestFiller(base.TestCase):
|
|||||||
self.stubs.Set(client.tenants, 'create', create_tenant)
|
self.stubs.Set(client.tenants, 'create', create_tenant)
|
||||||
self.stubs.Set(filler, 'create_swift_user', create_swift_user)
|
self.stubs.Set(filler, 'create_swift_user', create_swift_user)
|
||||||
|
|
||||||
concurrency = int(utils.get_config('filler', 'concurrency'))
|
concurrency = int(utils.get_config('concurrency',
|
||||||
|
'keystone_client_concurrency'))
|
||||||
pile = eventlet.GreenPile(concurrency)
|
pile = eventlet.GreenPile(concurrency)
|
||||||
filler.create_swift_account(client, pile, 3, 1, self.ret_index)
|
filler.create_swift_account(client, pile, 3, 1, self.ret_index)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user