(I'm currently working with Faidon, specifically on container-sync for our swift deployment)
I think more parallelism would help regardless when processing many containers, something like this (not an actual patch, just a sketch to explain the idea)
--- a/swift/container/sync.py
+++ b/swift/container/sync.py
@@ -21,6 +21,7 @@ from random import choice, random, shuffle
from struct import unpack_from
from eventlet import sleep, Timeout
+from eventlet.greenpool import GreenPool
(I'm currently working with Faidon, specifically on container-sync for our swift deployment)
I think more parallelism would help regardless when processing many containers, something like this (not an actual patch, just a sketch to explain the idea)
--- a/swift/ container/ sync.py container/ sync.py
+++ b/swift/
@@ -21,6 +21,7 @@ from random import choice, random, shuffle
from struct import unpack_from
from eventlet import sleep, Timeout
+from eventlet.greenpool import GreenPool
import swift.common.db .backend import ContainerBroker, DATADIR Daemon) :
self. _myport = int(conf. get('bind_ port', 6001))
swift. common. db.DB_PREALLOCA TION = \
config_ true_value( conf.get( 'db_preallocati on', 'f')) int(conf. get('concurrenc y', 1)))
from swift.container
@@ -157,6 +158,7 @@ class ContainerSync(
+ self.pool = GreenPool(
def get_object_ ring(self, policy_idx): Daemon) :
mount_check= self.mount_ check,
logger= self.logger) sync(path) spawn_n( self.container_ sync, path)
self.report( )
elapsed = time() - begin
sleep( self.interval - elapsed) Daemon) :
mount_ check=self. mount_check,
logger= self.logger) sync(path) spawn_n( self.container_ sync, path)
self. report( )
self. report( )
self. logger. info(
"""
@@ -178,9 +180,10 @@ class ContainerSync(
for path, device, partition in all_locs:
- self.container_
+ self.pool.
if time() - self.reported >= 3600: # once an hour
+ self.pool.waitall()
if elapsed < self.interval:
@@ -195,9 +198,10 @@ class ContainerSync(
for path, device, partition in all_locs:
- self.container_
+ self.pool.
if time() - self.reported >= 3600: # once an hour
+ self.pool.waitall()
elapsed = time() - begin
--
2.1.1