You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2019/03/05 00:35:07 UTC
[Bug 63232] New: CacheDirLength is not a good default
https://bz.apache.org/bugzilla/show_bug.cgi?id=63232
Bug ID: 63232
Summary: CacheDirLength is not a good default
Product: Apache httpd-2
Version: 2.4-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_cache_disk / mod_disk_cache
Assignee: bugs@httpd.apache.org
Reporter: hchuang95@gmail.com
Target Milestone: ---
The default CacheDirLength is 2.
However, the document(https://httpd.apache.org/docs/2.4/caching.html#examples)
says: "Unless you have a good reason not to, using a setting of "1" for
CacheDirLength is recommended."
So maybe the default CacheDirLength should be changed to 1.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 63232] CacheDirLength is not a good default
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63232
--- Comment #1 from Rich Bowen <rb...@apache.org> ---
The documentation for CacheDirLength correctly states the default
is 2, which matches the code (DEFAULT_DIRLENGTH in
mod_cache_disk.h, line 66).
However, the caching guide (caching.html) recommends a value of 1,
stating: "Unless you have a good reason not to, using a setting of
1 for CacheDirLength is recommended."
When our own documentation recommends a value different from the
default, that's a signal that the default should change. Defaults
should reflect best practice so that users get good behavior out of
the box without needing to discover and follow a recommendation
buried in a guide page.
Proposing we change DEFAULT_DIRLENGTH from 2 to 1 in
modules/cache/mod_cache_disk.h to match the documented
recommendation.
Patch:
--- a/modules/cache/mod_cache_disk.h
+++ b/modules/cache/mod_cache_disk.h
@@ -65,2 +65,2 @@
#define DEFAULT_DIRLEVELS 2
-#define DEFAULT_DIRLENGTH 2
+#define DEFAULT_DIRLENGTH 1
Update directive docs default in
docs/manual/mod/mod_cache_disk.xml:
- <default>CacheDirLength 2</default>
+ <default>CacheDirLength 1</default>
And update the recommendation in docs/manual/caching.xml
(around line 497) since the advice now matches the default:
- <p>The overall aim of this technique is to reduce the number of
- subdirectories or files that may be in a particular directory,
- as most file-systems slow down as this number increases. With
- setting of "1" for
- <directive module="mod_cache_disk">CacheDirLength</directive>
- there can at most be 64 subdirectories at any particular level.
- With a setting of 2 there can be 64 * 64 subdirectories, and so on.
- Unless you have a good reason not to, using a setting of "1"
- for <directive module="mod_cache_disk">CacheDirLength</directive>
- is recommended.</p>
+ <p>The overall aim of this technique is to reduce the number of
+ subdirectories or files that may be in a particular directory,
+ as most file-systems slow down as this number increases. With
+ the default setting of "1" for
+ <directive module="mod_cache_disk">CacheDirLength</directive>
+ there can at most be 64 subdirectories at any particular level.
+ With a setting of 2 there can be 64 * 64 subdirectories, and so on.
+ The default of "1" is appropriate for most configurations.</p>
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org