Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
11
  • Loading branch information
javalive committed Jun 11, 2020
1 parent 8727d2e commit 36645bb
Show file tree
Hide file tree
Showing 9 changed files with 451 additions and 2 deletions.
18 changes: 18 additions & 0 deletions admin/adv_topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@ Memory-Only 모드란 디스크를 이용하지 않고 컨텐츠를 메모리에



.. _adv_topics_volatile:

Volatile 가상호스트
====================================

특정 가상호스트만 `Memory-Only 모드`_ 로 동작하도록 지정한다.
이를 **Volatile 가상호스트** 라고 부른다. ::

# vhosts.xml - <Vhosts>

<Vhost Name="foo.com" Volatile="OFF"> ... </Vhost>


`Memory-Only 모드`_ 라면 ``Volatile (기본: OFF)`` 키워드는 무시된다.
디스크모드라면 ``Volatile="ON"`` 인 가상호스트는 `Memory-Only 모드`_ 로 동작한다.



.. _adv_topics_mem:

메모리 구조
Expand Down
Binary file added admin/img/prefetch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/img/prefetch_schedule1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/img/prefetch_struct.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions admin/origin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,52 @@ API를 통해 가상호스트의 원본서버 배제/복구를 초기화한다.
=========== =================================================================== =====================================================


.. _origin-balancemode-url-suffix-ignore:

``Hash`` 분산 - Suffix 무시
---------------------

STON의 많은 기능은 기존 URL 뒤에 명령어를 붙이는 형식이다. ::

http://example.com/origin.jpg/...{명령어}...
http://example.com/origin.jpg/dims/resize/100x100


자칫 이런 명령어들이 ``Hash`` 모드 원본분산 시 HIT율 저하의 원인이 되기도 한다.
예를 들어 다음 URL들은 모두 같은 원본파일을 변형하지만 URL이 다르다. ::

http://example.com/origin.jpg/dims/resize/100x100
http://example.com/origin.jpg/dims/strip/on/autorotate/on
http://example.com/origin.jpg/dims/grayscale/true

결과적으로 각기 다른 원본서버가 선택되면 불필요한 원본부하가 발생한다.


이런 경우를 방지하기 위해 URL 중 매칭되는 Suffix를 무시하도록 설정한다. ::


# server.xml - <Server><VHostDefault><OriginOptions>
# vhosts.xml - <Vhosts><Vhost><OriginOptions>

<BalanceHashRules>
<IgnoreSuffix>/dims/</IgnoreSuffix>
<IgnoreSuffix>?start=</IgnoreSuffix>
</BalanceHashRules>


- ``<BalanceHashRules>`` 원본서버 ``Hash`` 분산시에만 동작하며 URL을 Hash할 때 ``<IgnoreSuffix>`` 와 매칭되는 영역 이후를 모두 무시한다.

위와 같이 ``<IgnoreSuffix>/dims/</IgnoreSuffix>`` 를 설정해 두면 예제의 3 URL들은 모두 같은 원본서버를 선택한다. ::

http://example.com/origin.jpg # /dims/resize/100x100 무시
http://example.com/origin.jpg # /dims/strip/on/autorotate/on 무시
http://example.com/origin.jpg # /dims/grayscale/true 무시


``<BalanceHashRules>`` 은 원본서버 선택에만 관여할 뿐 URL을 변형시키는 것은 아니다.



세션 재사용
====================================

Expand Down

0 comments on commit 36645bb

Please sign in to comment.