Php/docs/mysqlnd-qc.configuration
运行时配置
这些函数的行为受 php.ini 中的设置影响。
| 名字 | 默认 | 可修改范围 | 更新日志 |
|---|---|---|---|
| mysqlnd_qc.enable_qc | 1 | PHP_INI_SYSTEM | |
| mysqlnd_qc.ttl | 30 | PHP_INI_ALL | |
| mysqlnd_qc.cache_by_default | 0 | PHP_INI_ALL | |
| mysqlnd_qc.cache_no_table | 0 | PHP_INI_ALL | |
| mysqlnd_qc.use_request_time | 0 | PHP_INI_ALL | |
| mysqlnd_qc.time_statistics | 1 | PHP_INI_ALL | |
| mysqlnd_qc.collect_statistics | 0 | PHP_INI_ALL | |
| mysqlnd_qc.collect_statistics_log_file | /tmp/mysqlnd_qc.stats | PHP_INI_SYSTEM | |
| mysqlnd_qc.collect_query_trace | 0 | PHP_INI_SYSTEM | |
| mysqlnd_qc.query_trace_bt_depth | 3 | PHP_INI_SYSTEM | |
| mysqlnd_qc.collect_normalized_query_trace | 0 | PHP_INI_SYSTEM | |
| mysqlnd_qc.ignore_sql_comments | 1 | PHP_INI_ALL | |
| mysqlnd_qc.slam_defense | 0 | PHP_INI_SYSTEM | |
| mysqlnd_qc.slam_defense_ttl | 30 | PHP_INI_SYSTEM | |
| mysqlnd_qc.std_data_copy | 0 | PHP_INI_SYSTEM | |
| mysqlnd_qc.apc_prefix | qc_ | PHP_INI_ALL | |
| mysqlnd_qc.memc_server | 127.0.0.1 | PHP_INI_ALL | |
| mysqlnd_qc.memc_port | 11211 | PHP_INI_ALL | |
| mysqlnd_qc.sqlite_data_file | :memory: | PHP_INI_ALL |
这是配置指令的简短说明。
mysqlnd_qc.enable_qcintEnables or disables the plugin. If disabled the extension will not plug into mysqlnd to proxy internal mysqlnd C API calls.
mysqlnd_qc.ttlintDefault Time-to-Live (TTL) for cache entries in seconds.
mysqlnd_qc.cache_by_defaultintCache all queries regardless if they begin with the SQL hint that enables caching of a query or not. Storage handler cannot overrule the setting. It is evaluated by the core of the plugin.
mysqlnd_qc.cache_no_tableintWhether to cache queries with no table name in any of columns meta data of their result set, for example,
SELECT SLEEP(1),SELECT NOW(),SELECT SUBSTRING().mysqlnd_qc.use_request_timeintUse PHP global request time to avoid
gettimeofday()system calls? If usingAPCstorage handler it should be set to the value ofapc.use_request_time, if not warnings will be generated.mysqlnd_qc.time_statisticsintCollect run time and store time statistics using
gettimeofday()system call? Data will be collected only if you also setmysqlnd_qc.collect_statistics = 1,mysqlnd_qc.collect_statisticsintCollect statistics for mysqlnd_qc_get_core_stats()? Does not influence storage handler statistics! Handler statistics can be an integral part of the handler internal storage format. Therefore, collection of some handler statistics cannot be disabled.
mysqlnd_qc.collect_statistics-log-fileintIf
mysqlnd_qc.collect_statisticsandmysqlnd_qc.collect_statistics_log_fileare set, the plugin will dump statistics into the specified log file at every 10th web request during PHP request shutdown. The log file needs to be writable by the web server user.Since 1.1.0.
mysqlnd_qc.collect_query_traceintCollect query back traces?
mysqlnd_qc.query_trace_bt_depthintMaximum depth/level of a query code backtrace.
mysqlnd_qc.ignore_sql_commentsintWhether to remove SQL comments from a query string before hashing it to generate a cache key. Disable if you do not want two statemts such as
SELECT /*my_source_ip=123*/ id FROM testandSELECT /*my_source_ip=456*/ id FROM testto refer to the same cache entry.Since 1.1.0.
mysqlnd_qc.slam_defenseintActivates handler based slam defense (cache stampeding protection) if available. Supported by
DefaultandAPCstorage handlermysqlnd_qc.slam_defense_ttlintTTLfor stale cache entries which are served while another client updates the entries. Supported byAPCstorage handler.mysqlnd_qc.collect_normalized_query_traceintCollect aggregated normalized query traces? The setting has no effect by default. You compile the extension using the define
NORM_QUERY_TRACE_LOGto make use of the setting.mysqlnd_qc.std_data_copyintDefault storage handler: copy cached wire data? EXPERIMENTAL – use default setting!
mysqlnd_qc.apc_prefixstringThe
APCstorage handler stores data in theAPCuser cache. The setting sets a prefix to be used for cache entries.mysqlnd_qc.memc_serverstringMEMCACHEstorage handler: memcache server host.mysqlnd_qc.memc_portintMEMCACHEstorage handler: memcached server port.mysqlnd_qc.sqlite_data_filestringsqlitestorage handler: data file. Any setting but:memory:may be of little practical value.