Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 11.4.0-client
-
Fix Version/s: 0.9.6
-
Component/s: Chef Client
-
Labels:None
Description
Given
file "/tmp/x" do owner "root" group "root" mode 0640 action :create end
where /tmp/x is a 2GB file already owned by root:root and mode 0640 - the entire thing will be read into memory to calculate the checksum despite it not being required. Found this was adding 200 seconds to my chef runs on one particular server with a large file.
The solution to me is to only checksum when necessary in the remote_file and template providers.
Looking for review @ http://github.com/mdkent/chef/tree/CHEF-1260
Only wrinkle in stopping the checksum by default was the set_content/compare_content that rely on it, chose to generate it on demand.
My other solution was to simply remove the 'content' attribute from the file provider/resource completely as a scan of the code and opscode cookbooks shows it's unused. It's also not mentioned in the wiki which points people to template and remote_file for managing file contents. But I'm guessing it was added with something particular in mind.