dogbutcat / gclone

fork from https://github.com/donwa/gclone
166 stars 28 forks source link

Avoid pacer sleep time #9

Closed erdincsk closed 2 years ago

erdincsk commented 2 years ago

Hello,

As far as i understand, if gclone selects a service account which has reached its dailiy copy limit (750gb) during a copy action, it waits ceartain amount of time to select next sa. i think exponential back off meachanism increases that sleep time during copy action from around 1 sec to 16 sec.

since i have a lot sa files in one folder and if gclone selects sa account which have reached it dailiy limits in a row, my copy action ends without copying files although there are still sa files in the folder which have not reached their dailiy limits.

My question is that, how can i avoid that sleep times and reduce them to 0 to switch sa files immediately if they reached the limit?

i'm sharing my command (yep includes python variables just dont take them seriously) and a section of log file below.

thanks.

command = [

    './'+gclone_folder+'/gclone', 'copy', 'ws-'+source_edu+':', 'ws-'+dest_edu+':',
    '--drive-server-side-across-configs', '--progress', '-vv', '--retries', '3',
    '--drive-random-pick-sa', '--drive-rolling-sa', '--drive-rolling-count=7',
    # '--drive-random-pick-sa',
    '--log-file='+os.path.expanduser('~/cloud-movie/google-api/log/yedekleme_'+log_time+'.log'),
    '--drive-service-account-file-path='+os.path.expanduser('~/cloud-movie/movie-yedekleme-ws/copy-sa/'+str(copy_sa_folder)),
    '--max-transfer', max_transfer, '--max-duration', timeout
]
Changing Service Account File from /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-4002-90.json to /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-4002-90.json
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 1.031245445s
2022/05/29 08:34:59 NOTICE: loading gclone sa file: /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-4002-90.json
2022/05/29 08:34:59 DEBUG : pacer: low level retry 3/10 (error googleapi: Error 403: User rate limit exceeded., userRateLimitExceeded)
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 2.432227608s
2022/05/29 08:34:59 DEBUG : Changing Service Account File from /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-6.json to /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-6.json
2022/05/29 08:34:59 NOTICE: loading gclone sa file: /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-6.json
2022/05/29 08:34:59 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: User rate limit exceeded., userRateLimitExceeded)
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 4.269071611s
2022/05/29 08:34:59 DEBUG : Changing Service Account File from /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-1002-16.json to /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-1002-16.json
2022/05/29 08:34:59 NOTICE: loading gclone sa file: /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-1002-16.json
2022/05/29 08:34:59 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: User rate limit exceeded., userRateLimitExceeded)
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 8.596541505s
2022/05/29 08:34:59 DEBUG : Changing Service Account File from /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-43.json to /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-43.json
2022/05/29 08:34:59 NOTICE: loading gclone sa file: /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-3002-43.json
2022/05/29 08:34:59 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: User rate limit exceeded., userRateLimitExceeded)
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 16.424363331s
2022/05/29 08:34:59 DEBUG : Changing Service Account File from /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-2002-76.json to /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-2002-76.json
2022/05/29 08:34:59 NOTICE: loading gclone sa file: /home/ubuntu/cloud-movie/movie-yedekleme-ws/copy-sa/2/ws-2002-76.json
2022/05/29 08:34:59 DEBUG : pacer: low level retry 1/10 (error googleapi: Error 403: User rate limit exceeded., userRateLimitExceeded)
2022/05/29 08:34:59 DEBUG : pacer: Rate limited, increasing sleep to 16.143918742s
dogbutcat commented 2 years ago

Sorry for late reply.

From your DEBUG log, I found every time Changing Service Account File action with same source and dest. In this situation, change sa action actually not work.

May I ask a question that is your folder with sa located on local file system?

dogbutcat commented 2 years ago

Close for stale.