summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-05-15 12:01:44 -0700
committerClaire McQuin <claire@getchef.com>2014-05-15 12:01:44 -0700
commit8bad4e917ac4f0da4cc6b3585bad17e66d6993df (patch)
treef66344ac295175f572b422f58c1bb4d9942a01dc
parentd73d0cb8166c2839944cdd9a048f5b7474f62ba7 (diff)
downloadchef-8bad4e917ac4f0da4cc6b3585bad17e66d6993df.tar.gz
Decrease number of default threads
-rw-r--r--DOC_CHANGES.md2
-rw-r--r--lib/chef/config.rb7
-rw-r--r--lib/chef/mixin/create_path.rb4
3 files changed, 8 insertions, 5 deletions
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index 01227ff4a6..00d15f7b18 100644
--- a/DOC_CHANGES.md
+++ b/DOC_CHANGES.md
@@ -36,4 +36,4 @@ You can now modify the chef-full template with the following options in `knife b
### Parallelize cookbook synchronization
-You can now synchronize your cookbooks faster by parallelizing the process. You can specify the number of helper threads in your config file with `cookbook_sync_threads NUM_THREADS`.
+You can now synchronize your cookbooks faster by parallelizing the process. You can specify the number of helper threads in your config file with `cookbook_sync_threads NUM_THREADS`. The default is 10. Increasing `NUM_THREADS` can result in gateway errors from the chef server (namely 503 and 504). If you are experiencing these often, consider decreasing `NUM_THREADS` to fewer than default.
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 0df9b4d62d..35b07c24ea 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -552,8 +552,11 @@ class Chef
# immediately if 0.)
default :run_lock_timeout, nil
- # Number of worker threads for syncing cookbooks in parallel.
- default :cookbook_sync_threads, 20
+ # Number of worker threads for syncing cookbooks in parallel. Increasing
+ # this number can result in gateway errors from the server (namely 503 and 504).
+ # If you are seeing this behavior while using the default setting, reducing
+ # the number of threads will help.
+ default :cookbook_sync_threads, 10
# If installed via an omnibus installer, this gives the path to the
# "embedded" directory which contains all of the software packaged with
diff --git a/lib/chef/mixin/create_path.rb b/lib/chef/mixin/create_path.rb
index ff20a65cb1..547224dda9 100644
--- a/lib/chef/mixin/create_path.rb
+++ b/lib/chef/mixin/create_path.rb
@@ -54,8 +54,8 @@ class Chef
def create_dir(path)
begin
- # In multithreaded environments, the following interleaving raises
- # an error here:
+ # When doing multithreaded downloads into the file cache, the following
+ # interleaving raises an error here:
#
# thread1 thread2
# File.directory?(create_path) <- false