cache.memcached.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. return [
  3. // @link http://github.com/gimpe/kohana-memcached
  4. /*
  5. 'memcached' => array(
  6. 'driver' => 'memcached',
  7. 'servers' => array(
  8. //array(
  9. // 'host' => 'localhost',
  10. // 'port' => 11211,
  11. // 'weight' => 1,
  12. // ),
  13. ),
  14. 'options' => array(
  15. // see http://php.net/manual/en/memcached.setoption.php and http://www.php.net/manual/en/memcached.constants.php
  16. //Memcached::OPT_COMPRESSION => TRUE,
  17. // Enables or disables payload compression. When enabled, item values longer than a certain threshold (currently 100 bytes) will be
  18. // compressed during storage and decompressed during retrieval transparently.
  19. // Type: boolean, default: TRUE.
  20. // more info https://github.com/iliaal/php-memcached/blob/master/memcached.ini
  21. //Memcached::OPT_SERIALIZER => Memcached::SERIALIZER_PHP,
  22. // Specifies the serializer to use for serializing non-scalar values. The valid serializers are Memcached::SERIALIZER_PHP or
  23. // Memcached::SERIALIZER_IGBINARY. The latter is supported only when memcached is configured with --enable-memcached-igbinary option and
  24. // the igbinary extension is loaded.
  25. // Type: integer, default: Memcached::SERIALIZER_PHP.
  26. //
  27. // Choices:
  28. // Memcached::SERIALIZER_PHP : The default PHP serializer.
  29. // Memcached::SERIALIZER_IGBINARY: The igbinary serializer. Instead of textual representation it stores PHP data structures in a
  30. // compact binary form, resulting in space and time gains.
  31. // Memcached::SERIALIZER_JSON : The JSON serializer. Requires PHP 5.2.10+.
  32. //Memcached::OPT_PREFIX_KEY => '',
  33. // This can be used to create a "domain" for your item keys. The value specified here will be prefixed to each of the keys. It cannot be
  34. // longer than 128 characters and will reduce the maximum available key size. The prefix is applied only to the item keys, not to the
  35. // server keys.
  36. // Type: string, default: "".
  37. //Memcached::OPT_HASH => Memcached::HASH_DEFAULT,
  38. // Specifies the hashing algorithm used for the item keys. The valid values are supplied via Memcached::HASH_* constants. Each hash
  39. // algorithm has its advantages and its disadvantages. Go with the default if you don't know or don't care.
  40. // Type: integer, default: Memcached::HASH_DEFAULT
  41. //
  42. // Choices:
  43. // Memcached::HASH_DEFAULT : The default (Jenkins one-at-a-time) item key hashing algorithm.
  44. // Memcached::HASH_MD5 : MD5 item key hashing algorithm.
  45. // Memcached::HASH_CRC : CRC item key hashing algorithm.
  46. // Memcached::HASH_FNV1_64 : FNV1_64 item key hashing algorithm.
  47. // Memcached::HASH_FNV1A_64: FNV1_64A item key hashing algorithm.
  48. // Memcached::HASH_FNV1_32 : FNV1_32 item key hashing algorithm.
  49. // Memcached::HASH_FNV1A_32: FNV1_32A item key hashing algorithm.
  50. // Memcached::HASH_HSIEH : Hsieh item key hashing algorithm.
  51. // Memcached::HASH_MURMUR : Murmur item key hashing algorithm.
  52. Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
  53. // Specifies the method of distributing item keys to the servers. Currently supported methods are modulo and consistent hashing.
  54. // Consistent hashing delivers better distribution and allows servers to be added to the cluster with minimal cache losses.
  55. // Type: integer, default: Memcached::DISTRIBUTION_MODULA.
  56. //
  57. // Choices:
  58. // Memcached::DISTRIBUTION_MODULA: Modulo-based key distribution algorithm.
  59. // Memcached::DISTRIBUTION_CONSISTENT: Consistent hashing key distribution algorithm (based on libketama).
  60. Memcached::OPT_LIBKETAMA_COMPATIBLE => TRUE,
  61. // Enables or disables compatibility with libketama-like behavior. When enabled, the item key hashing algorithm is set to MD5 and
  62. // distribution is set to be weighted consistent hashing distribution. This is useful because other libketama-based clients (Python,
  63. // Ruby, etc.) with the same server configuration will be able to access the keys transparently.
  64. // Note: It is highly recommended to enable this option if you want to use consistent hashing, and it may be enabled by default in future
  65. // releases.
  66. // Type: boolean, default: FALSE.
  67. //Memcached::OPT_BUFFER_WRITES => FALSE,
  68. // Enables or disables buffered I/O. Enabling buffered I/O causes storage commands to "buffer" instead of being sent. Any action that
  69. // retrieves data causes this buffer to be sent to the remote connection. Quitting the connection or closing down the connection will
  70. // also cause the buffered data to be pushed to the remote connection.
  71. // Type: boolean, default: FALSE.
  72. //Memcached::OPT_BINARY_PROTOCOL => FALSE,
  73. // Enable the use of the binary protocol. Please note that you cannot toggle this option on an open connection.
  74. // Type: boolean, default: FALSE.
  75. //Memcached::OPT_NO_BLOCK => FALSE,
  76. // Enables or disables asynchronous I/O. This is the fastest transport available for storage functions.
  77. // Type: boolean, default: FALSE.
  78. //Memcached::OPT_TCP_NODELAY => FALSE,
  79. // Enables or disables the no-delay feature for connecting sockets (may be faster in some environments).
  80. // Type: boolean, default: FALSE.
  81. //Memcached::OPT_SOCKET_SEND_SIZE => ,
  82. // The maximum socket send buffer in bytes.
  83. // Type: integer, default: varies by platform/kernel configuration.
  84. //Memcached::OPT_SOCKET_RECV_SIZE => ,
  85. // The maximum socket receive buffer in bytes.
  86. // Type: integer, default: varies by platform/kernel configuration.
  87. //Memcached::OPT_CONNECT_TIMEOUT => 1000,
  88. // In non-blocking mode this set the value of the timeout during socket connection, in milliseconds.
  89. // Type: integer, default: 1000.
  90. //Memcached::OPT_RETRY_TIMEOUT => 0,
  91. // The amount of time, in seconds, to wait until retrying a failed connection attempt.
  92. // Type: integer, default: 0.
  93. //Memcached::OPT_SEND_TIMEOUT => 0,
  94. // Socket sending timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the sending of data.
  95. // Type: integer, default: 0.
  96. //Memcached::OPT_RECV_TIMEOUT => 0,
  97. // Socket reading timeout, in microseconds. In cases where you cannot use non-blocking I/O this will allow you to still have timeouts on the reading of data.
  98. // Type: integer, default: 0.
  99. //Memcached::OPT_POLL_TIMEOUT => 1000,
  100. // Timeout for connection polling, in milliseconds.
  101. // Type: integer, default: 1000.
  102. //Memcached::OPT_CACHE_LOOKUPS => FALSE,
  103. // Enables or disables caching of DNS lookups.
  104. // Type: boolean, default: FALSE.
  105. //Memcached::OPT_SERVER_FAILURE_LIMIT => 0,
  106. // Specifies the failure limit for server connection attempts. The server will be removed after this many continuous connection failures.
  107. // Type: integer, default: 0.
  108. ),
  109. ),
  110. 'apc' => array
  111. (
  112. 'driver' => 'apc',
  113. 'default_expire' => 3600,
  114. ),
  115. 'file' => array
  116. (
  117. 'driver' => 'file',
  118. 'cache_dir' => APPPATH . 'cache',
  119. 'default_expire' => 3600,
  120. )
  121. */
  122. ];