Skip to content

Commit e6fb0d8

Browse files
committed
Raise the transfer concurrency of docs:upload
A documentation consists of thousands of small files, whose upload is bound by request round-trips: rclone defaults to 4 parallel transfers, the AWS CLI to 10 concurrent requests.
1 parent 5fea04c commit e6fb0d8

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎docs/maintainers.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ In order to deploy DevDocs, you must:
3737
aws configure --profile devdocs
3838
```
3939

40+
A documentation consists of thousands of small files, for which the default of 10 concurrent requests is low. Raising it speeds up `thor docs:upload` considerably:
41+
42+
```
43+
aws configure set s3.max_concurrent_requests 100 --profile devdocs
44+
aws configure set s3.max_queue_size 10000 --profile devdocs
45+
```
46+
4047
## Thor commands
4148

4249
In addition to the [publicly-documented commands](https://github.com/freeCodeCamp/devdocs#available-commands), the following commands are aimed at DevDocs maintainers:

‎lib/tasks/docs.thor‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ class DocsCLI < Thor
202202
puts "[S3] Syncing #{doc.path} using rclone..."
203203
# --checksum compares MD5 sums instead of size and modification time,
204204
# to avoid re-uploading the unchanged pages of a re-scraped documentation
205-
cmd = "rclone sync #{File.join(Docs.store_path, doc.path)} devdocs:devdocs-documents/#{doc.path} --checksum --delete-after --progress"
205+
# --transfers/--checkers raise the low defaults of 4/8, since a
206+
# documentation consists of thousands of small files
207+
cmd = "rclone sync #{File.join(Docs.store_path, doc.path)} devdocs:devdocs-documents/#{doc.path} --checksum --transfers 32 --checkers 64 --delete-after --progress"
206208
cmd << ' --dry-run' if options[:dryrun]
207209
end
208210
system(cmd)

0 commit comments

Comments
 (0)