info 命令/方法/函数

Description

Returns an associative array from REDIS that provides information about the server. Passing no arguments to INFO will call the standard REDIS INFO command, which returns information such as the following:

返回redis的相关系统信息,类似于PHP的PHPINFO();可以选择参数,按照选择的参数返回相应的信息,也可以不写参数,返回所有的信息。

info可以查看redis当前占用的内存大小、当前系统信息、持久化信息、key数量等。


redis_version

arch_bits

uptime_in_seconds

uptime_in_days

connected_clients

connected_slaves

used_memory 内存使用情况

changes_since_last_save

bgsave_in_progress

last_save_time

total_connections_received

total_commands_processed

role

You can pass a variety of options to INFO (per the Redis documentation), which will modify what is returned.

你可以通过多种选择的信息(每使用文档),这将是返回修改。


Parameters

option: The option to provide redis (e.g. "COMMANDSTATS", "CPU")

option:redis提供一些选项(如"COMMANDSTATS", "CPU")


Example

$redis->info(); /* standard redis INFO command */

$redis->info("COMMANDSTATS"); /* Information on the commands that have been run (>=2.6 only)

$redis->info("CPU"); /* just CPU information from Redis INFO */