Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 0 additions & 218 deletions documentation/en/user/source/configuration/storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ a thorough assessment of costs associated to seeding and serving caches**. Yet w
the bigger the size difference between two identical caches on S3 vs a regular file system. The S3 cache takes less space because the actual space used for each
tile is not padded to a file system block size. For example, the ``topp:states`` layer seeded up to zoom level 10 for EPSG:4326 with png8 format takes roughly
240MB on an Ext4 file system, and about 21MB on S3.
* Use in-memory caching. When serving S3 tiles from GeoWebcache, you can greately reduce the number of GET requests to S3 by configuring an in-memory cache as
described in the "In-Memory caching" section bellow. This will allow for frequently requested tiles to be kept in memory instead of retrieved from S3 on each
call.

The following is an example OpenLayers 3 HTML/JavaScript to set up a map that fetches tiles from a pre-seeded geowebcache layer directly from S3. We're using the typical
GeoServer ``topp:states`` sample layer on a fictitious ``my-geowebcache-bucket`` bucket, using ``test-cache`` as the cache prefix, png8 tile format, and EPSG:4326 CRS.
Expand Down Expand Up @@ -636,221 +633,6 @@ The *layer* parameter identifies the layer whose associated blob store content s

This are the only valid combinations of this parameters other combinations will ignore some of the provided parameters or will throw an exception.

In-Memory caching
-----------------

Default **blobstore** can be changed with a new one called **MemoryBlobStore**, which allows in memory tile caching. The **MemoryBlobStore** is a wrapper of a **blobstore**
implementation, which can be the default one(*FileBlobStore*) or another one. For using the new **blobstore** implementation, the user have to
modify the **blobstore** bean associated to the **gwcStorageBroker** bean (inside the Application Context file *geowebcache-core-context.xml*) by setting *gwcMemoryBlobStore*
instead of *gwcBlobStore*.

The configuration of a MemoryBlobStore requires a *blobstore* to wrap and a **CacheProvider** object. This one provides the caching mechanism for saving input data in memory.
User can define different caching objects but can only inject one of them inside the **MemoryBlobStore**. More information about the **CacheProvider** can be found in the next section.

An example of MemoryBlobStore configuration can be found beow:

.. code-block:: xml

<bean id="gwcMemoryBlobStore" class="org.geowebcache.storage.blobstore.memory.MemoryBlobStore" destroy-method="destroy">
<property name="store" ref="gwcBlobStore" />
<!-- "cacheProviderName" is optional. It is the name of the bean associated to the cacheProvider object used by this MemoryBlobStore-->
<property name="cacheBeanName" value="cacheProviderName" />
<!-- "cacheProvider" is optional. It is the Reference to a CacheProvider bean in the application context. -->
<property name="cacheProvider" ref="ExampleCacheProvider" />
</bean>

.. note:: Note that *cacheProviderName*/*cacheProvider* cannote be used together, if a *cacheProvider* is defined, the *cacheProviderName* is not considered. If *cacheProviderName*/*cacheProvider* are not defined, the **MemoryBlobStore** will internally search for a suitable **CacheProvider**.

CacheProvider configuration
+++++++++++++++++++++++++++

A **CacheProvider** object should be configured with an input object called **CacheConfiguration**. **CacheConfiguration** parameters are:

* *hardMemoryLimit* : which is the cache size in Mb
* *policy* : which can be LRU, LFU, EXPIRE_AFTER_WRITE, EXPIRE_AFTER_ACCESS, NULL
* *evitionTime* : which is the cache eviction time in seconds
* *concurrencyLevel* : which is the cache concurrency level

These parameters must be defined as properties in the **cacheConfiguration** bean in the Spring Application Context (like *geowebcache-core-context.xml*).

At the time of writing there are two implementations of the **CacheProvider** interface:

* **GuavaCacheProvider**
* **HazelcastCacheProvider**

GuavaCacheProvider
``````````````````````
**GuavaCacheProvider** provides local in-memory caching by using a `Guava <https://code.google.com/p/guava-libraries/wiki/CachesExplained>`_ *Cache* for storing the various GWC Tiles locally on the machine. For configuring a **GuavaCacheProvider**
the user must create a new bean in the Application Context file (like *geowebcache-core-context.xml*) and then add a reference to a **CacheConfiguration** instance.

Here is an example of configuration:

.. code-block:: xml

<bean id="cacheConfiguration" class="org.geowebcache.storage.blobstore.memory.CacheConfiguration">
<property name="hardMemoryLimit" value="64"/> <!-- 64 Mb -->
<property name="policy" value="EXPIRE_AFTER_ACCESS"/> <!-- Cache Eviction Policy is EXPIRE_AFTER_ACCESS. Other values are EXPIRE_AFTER_WRITE, NULL(LRU eviction based on cache size) -->
<property name="evitionTime" value="240"/> <!-- Eviction time is 240 seconds -->
<property name="concurrencyLevel" value="4"/> <!-- Concurrency Level of the cache is 4 -->
</bean>

<bean id="guavaCacheProvider" class="org.geowebcache.storage.blobstore.memory.guava.GuavaCacheProvider">
<property name="configuration" ref="cacheConfiguration"/> <!-- Setting of the configuration -->
</bean>


HazelcastCacheProvider
``````````````````````
**HazelcastCacheProvider** is useful for implementing distributed in memory caching for clustering. It internally uses `Hazelcast <http://docs.hazelcast.org/docs/3.3/manual/html/>`_ for handling distributed caching.
The **HazelcastCacheProvider** configuration requires another object called **HazelcastLoader**. This object accepts an Hazelcast instance or loads a file called *hazelcast.xml* from a proper directory defined
by the property "hazelcast.config.dir". If none of them is present, the CacheProvider object cannot be used.

The user must follow these rules for configuring the Hazelcast instance:

#. The Hazelcast configuration requires a Map object with name *CacheProviderMap*
#. Map eviction policy must be *LRU* or *LFU*
#. Map configuration must have a fixed size defined in Mb
#. Map configuration must have **USED_HEAP_SIZE** as *MaxSizePolicy*

Here the user can find both examples:

* From *hazelcast.xml*:

.. code-block:: xml

<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-2.3.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group>
<name>cacheCluster</name>
<password>geoserverCache</password>
</group>

<network>
<!--
Typical usage: multicast enabled with port auto-increment enabled
or tcp-ip enabled with port auto-increment disabled. Note that you
must choose between multicast and tcp-ip. Another option could be
aws, but will not be described here.

-->
<port auto-increment="false">5701</port>
<join>
<multicast enabled="false">
<multicast-group>224.2.2.3</multicast-group>
<multicast-port>54327</multicast-port>
</multicast>
<tcp-ip enabled="true">
<interface>192.168.1.32</interface>
<interface>192.168.1.110</interface>
</tcp-ip>
</join>
</network>
<map name="CacheProviderMap">
<eviction-policy>LRU</eviction-policy>
<max-size policy="USED_HEAP_SIZE">16</max-size>
</map>

</hazelcast>

And the related application context will be:

.. code-block:: xml

<bean id="HazelCastLoader1"
class="org.geowebcache.storage.blobstore.memory.distributed.HazelcastLoader">
</bean>

<bean id="HazelCastCacheProvider1"
class="org.geowebcache.storage.blobstore.memory.distributed.HazelcastCacheProvider">
<constructor-arg ref="HazelCastLoader1" />
</bean>

.. note:: Remember that in this case the user must define the *hazelcast.config.dir* property when starting the application.

* From application context (See Hazelcast documentation for more info):

.. code-block:: xml

<hz:hazelcast id="instance1">
<hz:config>
<hz:group name="dev" password="password" />
<hz:network port="5701" port-auto-increment="true">
<hz:join>
<hz:multicast enabled="true" multicast-group="224.2.2.3"
multicast-port="54327" />
<hz:tcp-ip enabled="false">
<hz:members>10.10.1.2, 10.10.1.3</hz:members>
</hz:tcp-ip>
</hz:join>
</hz:network>
<hz:map name="CacheProviderMap" max-size="16" eviction-policy="LRU"
max-size-policy="USED_HEAP_SIZE" />
</hz:config>
</hz:hazelcast>

<bean id="HazelCastLoader1"
class="org.geowebcache.storage.blobstore.memory.distributed.HazelcastLoader">
<property name="instance" ref="instance1" />
</bean>

<bean id="HazelCastCacheProvider1"
class="org.geowebcache.storage.blobstore.memory.distributed.HazelcastCacheProvider">
<constructor-arg ref="HazelCastLoader1" />
</bean>

Optional configuration parameters
``````````````````````````````````
In this section are described other available configuration parameters to configure:

* Cache expiration time:

.. code-block:: xml

<map name="CacheProviderMap">
...

<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>

</map>

Where *time-to-live-seconds* indicates how many seconds an entry can stay in cache and *max-idle-seconds* indicates how many seconds an entry may be not accessed before being evicted.

* Near Cache.

.. code-block:: xml

<map name="CacheProviderMap">
...
<near-cache>
<!--
Same configuration parameters of the Hazelcast Map. Note that size indicates the maximum number of
entries in the near cache. A value of Integer.MAX_VALUE indicates no limit on the maximum
size.
-->
<max-size>5000</max-size>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>60</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>

<!--
Indicates if a cached entry can be evicted if the same value is modified in the Hazelcast Map. Default is true.
-->
<invalidate-on-change>true</invalidate-on-change>

<!--
Indicates if local entries must be cached. Default is false.
-->
<cache-local-entries>false</cache-local-entries>
</near-cache>

</map>

Near Cache is a local cache for each cluster instance which is used for caching entries in the other cluster instances. This behaviour avoids to request those entries each time by executing a remote call. This feature could be helpful in order to improve Hazelcast Cache performances.

.. note:: A value of *max-size* bigger or equal to Integer.MAX_VALUE cannot be used in order to avoid an uncontrollable growth of the cache size.

OpenStack Swift (Swift) Blob Store
+++++++++++++++++++++++++++++++++++++++++++++

Expand Down
1 change: 0 additions & 1 deletion documentation/en/user/source/rest/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This section will discuss the GeoWebCache REST API.
seed.rst
diskquota.rst
masstruncate.rst
statistics.rst



Expand Down
72 changes: 0 additions & 72 deletions documentation/en/user/source/rest/statistics.rst

This file was deleted.

5 changes: 0 additions & 5 deletions documentation/en/user/source/webinterface/status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ Runtime statistics

The Status page displays basic runtime statistics including: uptime; how many requests have been made; total and peak throughput and statitics over intervals of 3, 15, and 60 seconds.

In Memory Cache statistics
--------------------------

If the **blobstore** object used is an instance of **MemoryBlobStore**, the user can find a new section called *In Memory Cache statistics*, containing the statistics of the cache used
by the **blobstore**. Note that these statistics are related to the local entries, even in case of distributed in-memory caching.
Loading
Loading