「キャッシュ定義」の版間の差分

提供:MoodleDocs
移動先:案内検索
82行目: 82行目:
===設定 Config settings===
===設定 Config settings===


サイト設定をキャッシュします。これはコアおよびプラグインすべての管理設定です。This is the administration settings in both core and all plugins.
サイト設定をキャッシュします。これはコアおよびプラグインすべての管理設定です。


This cache is going to be accessed on every single page within Moodle, regradless of the users state or what is being done.<br />
このキャッシュはMoodle内のページすべてにおいて毎回アクセスされます。This cache is going to be accessed on every single page within Moodle, regradless of the users state or what is being done.<br />
You should map this cache to the fastest backend you've got available.
You should map this cache to the fastest backend you've got available.



2019年7月2日 (火) 15:01時点における版


作成中です - Mitsuhiro Yoshida (トーク)

このページにはコアのキャッシュ定義に関する情報を含みます。この情報はMoodleのキャッシングシステムを最大限活用したい管理者に有用です。それぞれのキャッシュに関する情報はどのバックエンドがどの定義を使用するのか決定するのに役立ちます。

規模の小さなサイトまたは単一バックエンドが適用されている単一サーバの場合、memcache等によりパフォーマンスをすぐに改善することができます。
しかし、少しの計画と注意深いマッピングにより、あなたはさらにパフォーマンスを改善することができます。

このドキュメントの内容

コア内の各キャッシュ定義にはヘッディングおよびキャッシュ説明を含みます。
名称および説明と同じく以下の情報も詳述されます:

時期:このキャッシュ定義が最初にMoodleに導入された時期です。
コンポーネントエリア: このコードが属するコードコンポーネントおよび割り当てられたエリア (ユニークな単純な名称) です。
増加: このキャッシュが固定サイズになる場合、またはサイトデータの増加に伴い増加できる場合に宣言します。恐らく、どのようにキャッシュが増加するかに関する情報です。
誰: どのユーザがキャッシュから恩恵を受けるか。
優先度: サイトでの予想されるキャッシュの使用に関する表示です。値は1から5の間です。キャッシュが固定サイズであり、アクセスされた場合にすべてのページでの使用が期待できる場合、利用できる最速のバックエンドへの割り当てが得策であると考えられるため、優先度に5が割り当てられます。反対に急速に増加すると予想され特定のページのみでアクセスされるキャッシュには優先度1が与えられます。これは特定のユーザのみ (例 教師または管理者) に適用されます。あなたのサイトにキャッシングを実装する方法を決定する場合、あなたは少なくともこのキャッシュを配慮すべきです。

大規模サイトのキャッシュ設定に関するメモ

それぞれの異なるキャッシュは個別に設定できます。また、管理者は特定のシステムのために独自に「チューニング」できます。
デフォルトではこれらのキャッシュすべてはファイルシステムを使用するよう設定されています。通常、これは小さな単一サーバのシステムに適切です。

しかし、クラスタでは共有ファイルシステムが遅いため、これらのデフォルトでは問題が発生する可能性があります。そのため、この場合、代わりにmemcachedのような速い共有キャッシュバックエンドの使用をお勧めします。多くの場合、これらのキャッシュは共有の下に動作することを前提とされている点に留意してください。
あなたは場合によってはローカルファイルシステムのような非共有キャッシュの使用を選択することができます。しかし、これらのインスタンスではシステム管理の一環として忘れずに手動でキャッシュをクリアしてください。

アプリケーションキャッシュ

アプリケーションキャッシュは共有キャッシュです。

コースのモジュールおよセクションに関する累積情報

コースモジュールに関する累積情報、「get_fast_modinfo()」と同様にコースページを表示するために使用されるセクション。
このキャッシュは「rebuild_course_cache()」内で強制的にリセットされます。

これは実運用サイトのキャッシングを最適化できる素晴らしいキャッシュです。
主にコースページ、および非常に頻繁にアクセスされ費用のかかるページのためにアクセスされます。また、コース、セクションまたは活動で情報を検索または表示する時にMoodle内で頻繁に呼ばれる関数「get_fast_modinot()」内で利用されます。

Moodle 2.6以降
コンポーネント/エリア: core, coursemodinfo
成長: 指数、コース数、コース内のセクション数およびセクション内の活動数がキャッシュサイズを決定します。
誰: 全員。このキャッシュはすべてのページでアクセスされるわけではありませんが、コースと関連付けられているため、あなたはキャッシュへのアクセスはまだ高いと予想できます。
優先度: 4

カレンダー購読

カレンダー購読をキャッシュする。
これは特定の場所に素早くアクセスするためにデータベースからカレンダー購読レコードを保存するための非常に極めてシンプルなキャッシュです。

あなたのユーザが多くのカレンダーを購読しそうにない限り、これは優先度の低いキャッシュと考えるべきです。
保存される実データは非常に小さなものとなります。あなたに多くのカレンダー購読マッピングがある場合、このキャッシュ定義は速く小さなバックエンドにすることが理想的です。

Moodle 2.5以降
コンポーネント/エリア: core, calendar_subscriptions
成長: ユーザに作成されたカレンダー購読数により決定されます。あなたのユーザに完全に依存します。
誰: カレンダーページのカレンダーを購読している人すべて、カレンダーが表示されるブロック
優先度: 1

高度な複数サーバサイトに関するメモ

  • キャッシュとは:- 「event_subscriptions」テーブルからのレコードエントリです。様々なカレンダー購読に対応します。
  • キャッシュが更新されるタイミング:- カレンダー購読が更新または削除される時
  • アクセス頻度:- カレンダー投稿詳細が取得されるたび
  • いつキャッシュが完全に削除されるか - これは不要です。

用語リンク Concept linking [mod_glossary]

用語集フィルタの用語をキャッシュします。

用語はサイトまたはコースに関してキャッシュされます。コースIDがコースのキーとして使用される場合、「0」はサイト用語のキーとして使用されます。
キャッシュ内のそれぞれのアイテムは2つのアイテムにより構成される配列です。最初の配列は用語集、2番目の配列は用語です。
実際に保存されるデータは最小となります。仮に大きなサイトであるとしても、このキャッシュに必要なストレージは比較的小さなものとなります。

重要 このキャッシュをローカルキャッシュにはできません。共有キャッシュにしてください。

Since: Moodle 2.7 (MDL-44366) Moodle 2.7 (MDL-44366) 以降
コンポーネント/エリア: mod_glossary, concepts
成長: 実験的、用語集数および用語集内のアイテム数がこのキャッシュのサイズを決定します。
誰: 用語集フィルタが有効にされた場合、誰でも。
優先度: 3

設定 Config settings

サイト設定をキャッシュします。これはコアおよびプラグインすべての管理設定です。

このキャッシュはMoodle内のページすべてにおいて毎回アクセスされます。This cache is going to be accessed on every single page within Moodle, regradless of the users state or what is being done.
You should map this cache to the fastest backend you've got available.

Since: Moodle 2.4
Component/Area: core, config
Growth: fixed, the number of items is the number of settings in core and all installed plugins. This will only increase as settings are introduced or removed.
Who: everyone, on every page, without fail.
Priority: 5

Notes for advanced, multi-server sites

  • Requires shared cache.
  • This cache is hit quite often for getting config settings.

コースカテゴリツリー Course categories tree

This cache stores the full course categories tree.

It is often used when navigating the course category structure and you can expect it to be hit in situations where either the full tree, or part of the tree is displayed.
This includes some elements that can be configured to display on the front page.
Its use will be determinent on how you have configured Moodle and what is set to be displayed.

Since: Moodle 2.5 (MDL-38147)
Component/Area: core, coursecattree
Growth: fixed, will be limited to the number of course categories on your site. During course creation this site will obviously grow, but in day to day use it should remain static.
Who: everyone.
Priority: 3

Notes for advanced, multi-server sites

  • Requires shared cache.
  • Gets invalidated when changesincoursecat event is triggered.

コースグループ情報 Course group information

Caches grouping information for courses.

Information is cached in relation to a course and is very simple. It is only used in situations where a course has defined groups and those groups are being used.
This cache can be expected to save 1 - 2 queries per page.

Since: Moodle 2.5 (MDL-34398)
Component/Area: core, groupdata
Growth: fixed, the number of courses and groups within those courses determines the size of this cache.
Who: all users accessing a course in which groups are used.
Priority: 2

Notes for advanced, multi-server sites

  • Gets updated when groups data is fetched for a course.
  • Requires shared cache.

データベースメタ情報 Database meta information

Caches meta information on database tables including information about columns.

This cache is a priority cache, it is accessed on nearly every page within Moodle and its operation can be expensive.
Each entry uses the table name as the key and the cached data is the structure of the database table.

Since: Moodle 2.4 (MDL-25290)
Component/Area: core, databasemeta
Growth: fixed, the number of database tables determines the size of this cache and may only change during upgrade and installation/deletion of plugins.
Who: everyone
Priority: 5

Notes for advanced, multi-server sites

  • Requires shared cache
  • If not shared, caches need to be invalidated after any DB structure change including creation of temporary tables.

イベント無効化 Event invalidation

This cache is used to manage event invalidation for the MUC API. This is an internal API and has no relation what so ever to the Event API introduced in 2.7.

This is not often used within Moodle and when it is used occurs when editing happens and multiple caches need to purged, not all of which may be shared and some which may be cleared when the user next touches the cache. The overall cache size should be relatively small, and as checking often occurs for these caches on page access it is recommended to map this cache to a fast backend.

Since: Moodle 2.4 (MDL-25290)
Component/Area: core, eventinvalidation
Growth: fixed, events are subscribed to by definitinos and will only change during upgrade and the installation and deletion of plugins.
Who: everyone, events get triggered by action and in disconnected caches this be not be reflected until the user next hits the page.
Priority: 4

Notes for advanced, multi-server sites

  • Whenever something is invalidated, it is purged immediately and an event record is created with the timestamp.
  • Requires shared cache.

イベントオブザーバ Event observers

This cache is used for storing list of event observers.

It is updated on install/update while initialising list of event observers.
This cache is accessed, when event is trigged.

Since: Moodle 2.6 (MDL-39846)
Component/Area: core, observers
Growth: ?
Who: ?
Priority: ?

Notes for advanced, multi-server sites

  • Requires shared cache.

特定ユーザの外部バッジ External badges for particular user

Used to store external badges.

Since: Moodle 2.5.2, 2.6 (MDL-40924)
Component/Area: core, externalbadges
Growth: ?
Who: ?
Priority: ?

条件付き利用制限の評価のための評定アイテムキャッシュGrade items cached for evaluating conditional availability [availability_grade, items]

Used to cache course grade items for conditional availability purposes.

Note: This cache sets a TTL (Time To Live) of 3600 (1 hour).

Since: Moodle 2.7 (MDL-44070)
Component/Area: availability_grade, items
Growth: ?
Who: ?
Priority: ?

HTML Purifier - クリーニング済みコンテンツ cleaned content

This is a cache of texts (forum posts, resources, intros etc etc) from all parts of Moodle, after it has been cleaned of possible malicious data.

Caches cleaned text in relation to user + context of the text being cleaned.

Tip: This data may be safetly stored in local caches on clusted nodes.

Since: Moodle 2.4.2, 2.5 (MDL-36297)
Component/Area: core, htmlpurifier
Growth: exponential, cleaned content is usually stored once for each user + context combination.
Who: everyone
Priority: 3


Notes for advanced, multi-server sites

In Moodle 2.5,

  • This expects a shared cache
  • If not shared, must be manually purged after every upgrade or change of $CFG->allowobjectembed setting

In Moodle 2.6 and later,

  • This works fine with local or shared node caches, you don't have to do anything special.

言語ストリングキャッシュ Language string cache

The language string cache is one of the most essential caches within Moodle, it caches each and every language file used within Moodle.
Its of fixed size as there are a finite number of languages and language files and as it is accessed one pretty much every page within Moodle.
This is a prime cache to configure, map it to the fastest backend you've got available.

The string cache uses the a hash of the revision, language, and component of a language file as the key, and the array found within the corrosponding file is the data.
Static acceleration is used on this cache to speed up subsequent request for a string within a given language file. This is essential as string are usually requested one by one and often only from a handful of language files.

Tip: Cache usage differs greatly between Admins + managers and teacher + students. Admins and managers being able to complete more actions and often across difference components and plugins often require that many more language files be accessed for a page than a user such as a teacher or student require.
When testing your cache configuration ensure you test as a student.

Since: Moodle 2.4 (MDL-25290)
Component/Area: core, string
Growth: fixed size, each language string file is cached here, its size will be fixed but will be determined by the number of languages available on your site.
Who: everyone, on every browsable page within Moodle.
Priority: 5

Notes for advanced, multi-server sites

  • If shared between sites please be aware that any language customisations will also be shared.

In Moodle 2.4 and Moodle 2.6:

  • Expects shared cache.
  • If not shared it must be manually purged after any language string change such as editing of local lang packs, updating of lang packs during upgrade, installation or uninstallation of languages.

In Moodle 2.6 and later:

  • Works fine with local or shared node caches, you don't have to do anything special.

利用可能な言語一覧 List of available languages

Caches a list of available languages.

This list of languages is used every time the list of languages is requested in a page.
Because of this the cache will be hit by on many pages within Moodle on any site with more than one language installed. As its a small, fixed size cache on a site with multiple languages installed its a good idea to map this to the fastest backend you've got available.

Since: Moodle 2.6 (MDL-41019)
Component/Area: core, langmenu
Growth: fixed, determined by the number of languages installed on the site.
Who: everyone
Priority: 4

コース連絡先一覧 List of course contacts

Used to cache course contacts.

Course contacts are displayed in several places throughout Moodle, they are in most situations considered public information (like course names) and can be seeing by all users.
The process of listing these course contacts can be expensive, however the course contacts are shown only on select pages.

Since: Moodle 2.5 (MDL-38596)
Component/Area: core, coursecontacts
Growth: the number of courses and the number of users with course contact roles determines this size of this cache.
Who: everyone, course contacts are public information and may be displayed in several places throughout Moodle that can be accessed by anyone.
Priority: 3

Notes for advanced, multi-server sites

  • This is accessed while rendering/searching course
  • Requires shared cache.

プラグイン情報マネージャ Plugin info manager

Caches information on installed plugins, enabled plugins, and present plugins.

This cache is heavily used when managing plugins for site through the admin interfaces.
Primarily people accessing this page benefit from the existence of this cache.

Note: This must be a shared cache.

Since: Moodle 2.5 (MDL-34401)
Component/Area: core, plugin_manager
Growth: fixed, the number of plugins determines the size of this cache.
Who: Administrators primarily.
Priority: 2

プラグイン情報 - ベース Plugin info - base

  • This cache is used by plugininfo_base class and stores plugin information.
  • This is accessed while loading/checking plugin versions from disk.
  • Requires shared cache.

プラグイン情報 - 活動モジュール Plugin info - activity modules

  • This cache is used by plugininfo_mod class and provide access to records in modules table.
  • This is accessed while loading/checking modules.
  • Requires shared cache.

プラグイン情報 - ブロック Plugin info - blocks

  • This cache is used by plugininfo_block class and provide access to records in block table.
  • This is accessed while loading/checking blocks.
  • Requires shared cache.

プラグイン情報 - フィルタ Plugin info - filters

  • This cache is used by plugininfo_filter class and stores names of all filters installed.
  • This is accessed while loading/checking installed filters.
  • Requires shared cache.

プラグイン情報 - リポジトリ Plugin info - repositories

  • This cache is used by plugininfo_repositories class and provide access to records in repository table.
  • This is accessed while loading enabled repositories.
  • Requires shared cache.

プラグイン情報 - ポートフォリオ Plugin info - portfolios

  • This cache is used by plugininfo_portfolio class and stores list of enabled portfolio plugins.
  • This is accessed while checking if portfolio is enabled.
  • Requires shared cache.

問題定義 Question definitions

Caches question definitions. This is used by the question bank class.

Since: Moodle 2.4 (MDL-34399)
Component/Area: core, questiondata
Growth: ?
Who: ?
Priority: ?

Notes for advanced, multi-server sites

  • This gets updated when question is loaded or edited.
  • Doesn't require data guarantee.
  • Requires shared cache.

条件による利用可否を評価するためのユーザ評定キャッシュ User grades cached for evaluating conditional availability

Since:
Component/Area: core, gradecondition
Growth:
Who:
Priority:

条件による利用可否を評価するためのユーザ評定キャッシュ[availability_grade, scores] User grades cached for evaluating conditional availability [availability_grade, scores]

Used to cache user grades for conditional availability purposes.

Note: This cache sets a TTL (Time To Live) of 3600 (1 hour).

Since: Moodle 2.7 (MDL-44070)
Component/Area: availability, scores
Growth: ?
Who: ?
Priority: ?

YUIモジュール定義 YUI Module definitions

Caches information on shifter YUI modules used within Moodle when JS caching is enabled.

Since: Moodle 2.5 (MDL-38391)
Component/Area: core, yuimodules
Growth: fixes, the number of Moodle YUI modules within core and plugins. This will only change during upgrade, or installation/removal of plugins.
Who: everyone, this is used when ever Moodle YUI modules are used on a page and that is most pages as of 2.8.
Priority: 5

Notes for advanced, multi-server sites

  • Requires shared cache.

セッションキャッシュ Session caches

Data cached here belongs to the user browsing the site.

特定ユーザのためのコースカテゴリ一覧 Course categories lists for particular user

Used to store data for course categories visible to current user. Helps to browse list of categories.
This is also used during course category management.

Since: Moodle 2.5 (MDL-38147)
Component/Area: core, coursecat
Growth: the number of categories and courses on the site that the user can see will determine the size of this for the current user.
Who: everyone, it is used within several front page elements.

Notes for advanced, multi-server sites

  • Requires shared cache.
  • Is invalidated when changesincoursecat or changesincourse event is trigged.

Moodle内でユーザの選択を保持するために使用されるデータ Data used to persist user selections throughout Moodle

Caches user selections that should persist for the lifetime of the users log in. This includes things like which categories the user has expanded in the course category management page.
Think of them like user preferences but with limited lifetime.

Since: Moodle 2.6 (MDL-42299)
Component/Area: core, userselections
Growth: exponential, depends upon how much the user interacts with things like expading categories.
Who: logged in users.

フォルダ名キャッシュ Folder name cache [repository_skydrive]

?

Since: Moodle 2.6 (MDL-30740)
Component/Area: repository_skydrive, foldername
Growth: ?
Who: ?
Priority: ?

リクエストキャッシュ Request caches

Caches here last only for the life time of the request and are only available to the browsing user.

コースカテゴリレコード Course categories records

Caches a list of course categories visible to the user.

Since: Moodle 2.5 (MDL-38147)
Component/Area: core, coursecatrecords
Growth: fixes, the number of categories on the site visible to the user will determine this.
Who: everyone

Notes for advanced, multi-server sites

  • This is accessed while rendering course category.
  • Is invalidated when changesincoursecat event is triggered.
  • Require local cache.

ヘルパキャシュ Helper caching [tool_uploadcourse]

Since: Moodle 2.6 (MDL-13114)
Component/Area: tool_uploadcourse, helper
Growth: ?
Who: Administrators
Priority: ?

リポジトリインスタンスデータ Repositories instances data

Used to cache data on configured repositories to avoid repetitive database calls to load repositories.

Since: Moodle 2.5 (MDL-34346)
Component/Area: core, repositories
Growth: ?
Who: logged in users with one or more accessible repositories.
Priority: ?

Notes for advanced, multi-server sites

  • Requires local cache.

詳細情報 More information

関連情報