trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [3/6] trafficserver git commit: TS-3505 Add documentation
Date Fri, 24 Apr 2015 14:06:07 GMT
TS-3505 Add documentation


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8fdac58e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8fdac58e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8fdac58e

Branch: refs/heads/master
Commit: 8fdac58e0de8558e79e1dc3732ab74adda38d049
Parents: 60e6e28
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Mon Apr 13 15:12:58 2015 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Fri Apr 24 07:57:57 2015 -0600

----------------------------------------------------------------------
 doc/reference/plugins/cache_promote.en.rst | 54 +++++++++++++++++++++++++
 plugins/experimental/cache_promote/README  | 30 ++++++++++++++
 2 files changed, 84 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8fdac58e/doc/reference/plugins/cache_promote.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/cache_promote.en.rst b/doc/reference/plugins/cache_promote.en.rst
new file mode 100644
index 0000000..0cb6082
--- /dev/null
+++ b/doc/reference/plugins/cache_promote.en.rst
@@ -0,0 +1,54 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+
+.. _cache-promote-plugin:
+
+cache_promote Plugin
+====================
+
+The `cache_promote` plugin provides a means to control when an object should
+be allowed to enter the cache. This is orthogonal from normal Cache-Control
+directives, providing a different set of policies to apply. The typical use
+case for this plugin is when you have a very large data set, where you want to
+avoid churning the ATS cache for the long tail content.
+
+All configuration is done via :file:`remap.config`, and the following options
+are available:
+
+    --policy   The promotion policy. `lru` and `chance` are supported
+    --chance   The sampling rate for the request to be considered
+
+For the `lru` plugin, the following options are also available:
+
+    --hits     The minimum number of hits before promotion
+    --buckets  The size (entries) of the LRU
+
+These two options combined with your usage patterns will control how likely a
+URL is to become promoted to enter the cache.
+
+Examples
+--------
+
+    map http://cdn.example.com/ http://some-server.example.com \
+      @plugin=cache_promote.so @pparam=--policy=chance --chance=10%
+
+    map http://cdn.example.com/ http://some-server.example.com \
+      @plugin=cache_promote.so @pparam=--policy=lru \
+      @pparam=--hits=10 @pparam=--buckets=10000
+
+Note that the `--chance` option is available for all policies, and when used
+to reduce pressure on the under heavy load.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8fdac58e/plugins/experimental/cache_promote/README
----------------------------------------------------------------------
diff --git a/plugins/experimental/cache_promote/README b/plugins/experimental/cache_promote/README
new file mode 100644
index 0000000..26d4500
--- /dev/null
+++ b/plugins/experimental/cache_promote/README
@@ -0,0 +1,30 @@
+LRU Design
+==========
+
+This got slightly complex, because I tried to be clever. But the concept is easy, a
+list and an unordered map keeps the LRU state.
+
+
+                                                    +-----------------------+    +----------------------------------+
+                                                    |        LRUList        |    |      
       LRUMap              |
+                                                    |        -------        |    |      
       ------              |
+                                                    |+---------------------+|    |+--------------------------------+|
++---------------------+   +---------------------+   ||      LRUEntry       <+----+| {LRUHash
*, LRUList::iterator} ||
+|       LRUHash       |   |      LRUEntry       |   |+---------------------+|    |+--------------------------------+|
+|      --------       |<--+      --------       |<--+|      LRUEntry       <+----+|
{LRUHash *, LRUList::iterator} ||
+|  u_char _hash[20]   |   | <LRUHash, unsigned> |   |+---------------------+|    |+--------------------------------+|
++---------------------+   +---------------------+   ||      LRUEntry       <+----+| {LRUHash
*, LRUList::iterator} ||
+                            +-----------------+     |+---------------------+|    |+--------------------------------+|
+                            | first = LRUHash |     |                       |    |      
                           |
+                            |second = unsigned|     |           *           |    |      
         *                 |
+                            +-----------------+     |           *           |    |      
         *                 |
+                                                    |           *           |    |      
         *                 |
+                                                    |                       |    |      
                           |
+                                                    |+---------------------+|    |+--------------------------------+|
+                                                    ||      LRUEntry       ||    || {LRUHash
*, LRUList::iterator} ||
+                                                    |+---------------------+|    |+--------------------------------+|
+                                                    +-----------------------+    +----------------------------------+
+                                                                                     +--------------------------+
+                                                                                     |  
 first  = LRUHash*     |
+                                                                                     |second
= LRUList::iterator|
+                                                                                     +--------------------------+


Mime
View raw message