当前位置: 首页 > news >正文

狮城app更多网站WordPress实现网址导航

狮城app更多网站,WordPress实现网址导航,wordpress 织梦转换,如何自学跨境电商⭐ 作者简介#xff1a;码上言 ⭐ 代表教程#xff1a;Spring Boot vue-element 开发个人博客项目实战教程 ⭐专栏内容#xff1a;个人博客系统 ⭐我的文档网站#xff1a;http://xyhwh-nav.cn/ 文章目录 Redis相关配置1、units2、Include3、loadmodule 加载模块4、NET… ⭐ 作者简介码上言 ⭐ 代表教程Spring Boot vue-element 开发个人博客项目实战教程 ⭐专栏内容个人博客系统 ⭐我的文档网站http://xyhwh-nav.cn/ 文章目录 Redis相关配置1、units2、Include3、loadmodule 加载模块4、NETWORK 网络设置5、GENERAL 通用6、SNAPSHOPTING 快照7、REPLICATION 主从复制8、SECURITY 安全9、CLIENTS 限制10、MEMORY MANAGEMENT内存管理11、append only模式12、常见配置 Redis相关配置 redis.conf 配置文件介绍在Redis的使用过程除了知道对Redis五种数据类型的操作方法之外最主要的就是对redis.conf进行配置。 Redis 的配置文件位于 Redis 安装目录下 1、units 配置大小单位开头定义了一些基本的度量单位只支持bytes不支持bit 表明unit的单位是不分大小写的。 # Note on units: when memory size is needed, it is possible to specify # it in the usual form of 1k 5GB 4M and so forth: # # 1k 1000 bytes # 1kb 1024 bytes # 1m 1000000 bytes # 1mb 1024*1024 bytes # 1g 1000000000 bytes # 1gb 1024*1024*1024 bytes # # units are case insensitive so 1GB 1Gb 1gB are all the same.2、Include 表明我们可以通过命令将多个.conf文件进行合并格式include /path/to/other.conf 和Spring配置文件类似可以通过includes包含redis.conf 可以作为总文件可以包含其他文件 # Note that option include wont be rewritten by command CONFIG REWRITE # from admin or Redis Sentinel. Since Redis always uses the last processed # line as value of a configuration directive, youd better put includes # at the beginning of this file to avoid overwriting config change at runtime. # # If instead you are interested in using includes to override configuration # options, it is better to use include as the last line. # # include /path/to/local.conf # include /path/to/other.conf3、loadmodule 加载模块 通过这里的 loadmodule 配置将引入自定义模块来新增一些功能。 # Load modules at startup. If the server is not able to load modules # it will abort. It is possible to use multiple loadmodule directives. # # loadmodule /path/to/my_module.so # loadmodule /path/to/other_module.so4、NETWORK 网络设置 ################################## NETWORK #####################################.......# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES# JUST COMMENT OUT THE FOLLOWING LINE.# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# 默认只能本机访问如果是远程调用或者虚拟机调用需要将其注释掉bind 127.0.0.1 -::1 ......# By default protected mode is enabled. You should disable it only if# you are sure you want clients from other hosts to connect to Redis# even if no authentication is configured, nor a specific set of interfaces# are explicitly listed using the bind directive.# 如果你想要通过其他主机连接redis那么你需要将protected-mode设为noprotected-mode yes# Accept connections on the specified port, default is 6379 (IANA #815344).# If port 0 is specified Redis will not listen on a TCP socket.# 6379是redis的默认端口号你可以在这里修改redis的端口号port 6379......# Close the connection after a client is idle for N seconds (0 to disable)# 超时设置timeout 05、GENERAL 通用 # By default Redis does not run as a daemon. Use yes if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. # When Redis is supervised by upstart or systemd, this parameter has no impact. daemonize yes # 默认情况下Redis不作为守护进程运行。需要开启的话改为 yes# Note: these supervision methods only signal process is ready. # They do not enable continuous pings back to your supervisor. # # The default is no. To run under upstart/systemd, you can simply uncomment # the line below: # supervised no # 可通过upstart和systemd管理Redis守护进程# Note that on modern Linux systems /run/redis.pid is more conforming # and should be used instead. pidfile /var/run/redis_6379.pid # 以后台进程方式运行redis则需要指定pid 文件loglevel notice # 日志级别。可选项有 # debug记录大量日志信息适用于开发、测试阶段 # verbose较多日志信息 # notice适量日志信息使用于生产环境 # warning仅有部分重要、关键信息才会被记录。logfile # 日志文件的位置当指定为空字符串时为标准输出# Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT dbid where # dbid is a number between 0 and databases-1 databases 16 # 设置数据库的数目。默认的数据库是DB 0# However it is possible to force the pre-4.0 behavior and always show a # ASCII art logo in startup logs by setting the following option to yes. always-show-logo yes # 是否总是显示logo6、SNAPSHOPTING 快照 # 900秒15分钟内至少1个key值改变才会进行保存则进行数据库保存--持久化 save 900 1# 300秒5分钟内至少10个key值改变才会进行保存则进行数据库保存--持久化 save 300 10# 60秒1分钟内至少10000个key值改变才会进行保存则进行数据库保存--持久化 save 60 10000stop-writes-on-bgsave-error yes # 持久化出现错误后是否依然进行继续进行工作rdbcompression yes # 使用压缩rdb文件 yes压缩但是需要一些cpu的消耗。no不压缩需要更多的磁盘空间rdbchecksum yes # 是否校验rdb文件更有利于文件的容错性但是在保存rdb文件的时候会有大概10%的性能损耗dbfilename dump.rdb # dbfilenamerdb文件名称dir ./ # dir 数据目录数据库的写入会在这个目录。rdb、aof文件也会写在这个目录默认为当前目录7、REPLICATION 主从复制 # When a replica loses its connection with the master, or when the replication # is still in progress, the replica can act in two different ways: # # 1) if replica-serve-stale-data is set to yes (the default) the replica will # still reply to client requests, possibly with out of date data, or the # data set may just be empty if this is the first synchronization. # # 2) If replica-serve-stale-data is set to no the replica will reply with # an error SYNC with master in progress to all commands except: # INFO, REPLICAOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, SUBSCRIBE, # UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, COMMAND, POST, # HOST and LATENCY. # replica-serve-stale-data yes# Note: read only replicas are not designed to be exposed to untrusted clients # on the internet. Its just a protection layer against misuse of the instance. # Still a read only replica exports by default all the administrative commands # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve # security of read only replicas using rename-command to shadow all the # administrative / dangerous commands. replica-read-only yes# With slow disks and fast (large bandwidth) networks, diskless replication # works better. repl-diskless-sync no# The delay is specified in seconds, and by default is 5 seconds. To disable # it entirely just set it to 0 seconds and the transfer will start ASAP. repl-diskless-sync-delay 5 ......8、SECURITY 安全 # ACL LOG # # The ACL Log tracks failed commands and authentication events associated # with ACLs. The ACL Log is useful to troubleshoot failed commands blocked # by ACLs. The ACL Log is stored in memory. You can reclaim memory with # ACL LOG RESET. Define the maximum entry length of the ACL Log below. acllog-max-len 1289、CLIENTS 限制 # IMPORTANT: When Redis Cluster is used, the max number of connections is also # shared with the cluster bus: every node in the cluster will use two # connections, one incoming and another outgoing. It is important to size the # limit accordingly in case of very large clusters. # # 设置客户端的最大连接数 # maxclients 10000 10、MEMORY MANAGEMENT内存管理 # In short... if you have replicas attached it is suggested that you set a lower # limit for maxmemory so that there is some free RAM on the system for replica # output buffers (but this is not needed if the policy is noeviction). # # 你可以设置redis的最大内存redis在未进行持久化之前数据是存在内存中的断电即失 # maxmemory bytes# Note: with any of the above policies, when there are no suitable keys for # eviction, Redis will return an error on write operations that require # more memory. These are usually commands that create new keys, add data or # modify existing keys. A few examples are: SET, INCR, HSET, LPUSH, SUNIONSTORE, # SORT (due to the STORE argument), and EXEC (if the transaction includes any # command that requires memory). # # The default is: # # 设置key过期的策略 # maxmemory-policy noevictionmaxmemory-policy 六种策略 volatile-lru只最近最少使用算法从设置了过期时间的键中选择空转时间最长的键值对清除掉allkeys-lru 最近最少使用算法从所有的键中选择空转时间最长的键值对清除volatile-random从设置了过期时间的键中随机选择键进行清除allkeys-random所有的键中随机选择键进行删除volatile-ttl 从设置了过期时间的键中选择过期时间最早的键值对清除noeviction 不做任何的清理工作在redis的内存超过限制之后所有的写入操作都会返回错误但是读操作都能正常的进行; 11、append only模式 appendonly no # 是否以append only模式作为持久化方式默认使用的是rdb方式持久化这种方式在许多应用中已经足够用了appendfilename appendonly.aof # appendfilename AOF 文件名称appendfsync everysec # appendfsync aof持久化策略的配置 # no表示不执行fsync由操作系统保证数据同步到磁盘速度最快。 # always表示每次写入都执行fsync以保证数据同步到磁盘。 # everysec表示每秒执行一次fsync可能会导致丢失这1s数据。AOF Redis 默认不开启。它的出现是为了弥补RDB的不足数据的不一致性所以它采用日志的形式来记录每个写操作并追加到文件中。Redis 重启的会根据日志文件的内容将写指令从前到后执行一次以完成数据的恢复工作。 12、常见配置 Redis默认不是以守护进程的方式运行可以通过该配置项修改使用yes启用守护进程 daemonize no当 Redis 以守护进程方式运行时Redis 默认会把 pid 写入 /var/run/redis.pid 文件可以通过 pidfile 指定 pidfile /var/run/redis.pid指定 Redis 监听端口默认端口为 6379 port 6379绑定的主机地址 bind 127.0.0.1 当客户端闲置多长秒后关闭连接如果指定为 0 表示关闭该功能 timeout 300指定日志记录级别Redis 总共支持四个级别debug、verbose、notice、warning默认为 notice loglevel notice日志记录方式默认为标准输出如果配置 Redis 为守护进程方式运行而这里又配置为日志记录方式为标准输出则日志将会发送给 /dev/null logfile stdout设置数据库的数量默认数据库为0可以使用SELECT 命令在连接上指定数据库id databases 16指定在多长时间内有多少次更新操作就将数据同步到数据文件可以多个条件配合 save seconds changesRedis 默认配置文件中提供了三个条件 save 900 1 save 300 10 save 60 10000 分别表示 900 秒15 分钟内有 1 个更改300 秒5 分钟内有 10 个更改以及 60 秒内有 10000 个更改。 指定存储至本地数据库时是否压缩数据默认为 yesRedis 采用 LZF 压缩如果为了节省 CPU 时间可以关闭该选项但会导致数据库文件变的巨大 rdbcompression yes指定本地数据库文件名默认值为 dump.rdb dbfilename dump.rdb指定本地数据库存放目录 dir ./设置当本机为 slave 服务时设置 master 服务的 IP 地址及端口在 Redis 启动时它会自动从 master 进行数据同步 slaveof masterip masterport当 master 服务设置了密码保护时slave 服务连接 master 的密码 masterauth master-password设置 Redis 连接密码如果配置了连接密码客户端在连接 Redis 时需要通过AUTH password命令提供密码默认关闭 requirepass foobared设置同一时间最大客户端连接数默认无限制Redis 可以同时打开的客户端连接数为 Redis 进程可以打开的最大文件描述符数如果设置 maxclients 0表示不作限制。当客户端连接数到达限制时Redis 会关闭新的连接并向客户端返回 max number of clients reached 错误信息 maxclients 128 指定 Redis 最大内存限制Redis 在启动时会把数据加载到内存中达到最大内存后Redis 会先尝试清除已到期或即将到期的 Key当此方法处理 后仍然到达最大内存设置将无法再进行写入操作但仍然可以进行读取操作。Redis 新的 vm 机制会把 Key 存放内存Value 会存放在 swap 区 maxmemory bytes指定是否在每次更新操作后进行日志记录Redis 在默认情况下是异步的把数据写入磁盘如果不开启可能会在断电时导致一段时间内的数据丢失。因为 redis 本身同步数据文件是按上面 save 条件来同步的所以有的数据会在一段时间内只存在于内存中。默认为 no appendonly no 指定更新日志文件名默认为 appendonly.aof appendfilename appendonly.aof指定更新日志条件共有 3 个可选值 no表示等操作系统进行数据缓存同步到磁盘快always表示每次更新操作后手动调用 fsync() 将数据写到磁盘慢安全everysec表示每秒同步一次折中默认值 appendfsync everysec 指定是否启用虚拟内存机制默认值为 no简单的介绍一下VM 机制将数据分页存放由 Redis 将访问量较少的页即冷数据 swap 到磁盘上访问多的页面由磁盘自动换出到内存中在后面的文章我会仔细分析 Redis 的 VM 机制 vm-enabled no 虚拟内存文件路径默认值为 /tmp/redis.swap不可多个 Redis 实例共享 vm-swap-file /tmp/redis.swap 将所有大于 vm-max-memory 的数据存入虚拟内存无论 vm-max-memory 设置多小所有索引数据都是内存存储的(Redis 的索引数据 就是 keys)也就是说当 vm-max-memory 设置为 0 的时候其实是所有 value 都存在于磁盘。默认值为 0 vm-max-memory 0Redis swap 文件分成了很多的 page一个对象可以保存在多个 page 上面但一个 page 上不能被多个对象共享vm-page-size 是要根据存储的 数据大小来设定的作者建议如果存储很多小对象page 大小最好设置为 32 或者 64bytes如果存储很大大对象则可以使用更大的 page如果不确定就使用默认值。 vm-page-size 32设置 swap 文件中的 page 数量由于页表一种表示页面空闲或使用的 bitmap是在放在内存中的在磁盘上每 8 个 pages 将消耗 1byte 的内存 vm-pages 134217728设置访问swap文件的线程数,最好不要超过机器的核数,如果设置为0,那么所有对swap文件的操作都是串行的可能会造成比较长时间的延迟。默认值为4 vm-max-threads 4设置在向客户端应答时是否把较小的包合并为一个包发送默认为开启 glueoutputbuf yes指定在超过一定的数量或者最大的元素超过某一临界值时采用一种特殊的哈希算法 hash-max-zipmap-entries 64 hash-max-zipmap-value 512指定是否激活重置哈希默认为开启后面在介绍 Redis 的哈希算法时具体介绍 activerehashing yes指定包含其它的配置文件可以在同一主机上多个Redis实例之间使用同一份配置文件而同时各个实例又拥有自己的特定配置文件 include /path/to/local.conf
http://www.pierceye.com/news/738888/

相关文章:

  • 济南专业网站优化花西子的网络营销策略
  • 武城网站建设费用网页设计试题及答案
  • 郑州外贸网站建设公司搜索引擎排名的三大指标
  • 温州专业微网站制作电台 主题 wordpress
  • wordpress做网站过程阳江网上车管所
  • 网站抓取qq上海自贸区注册公司流程
  • 深圳网站设计推荐刻烟台制作网站有哪些
  • 网站注册系统源码卢松松博客源码 wordpress博客模板
  • 网站开发进阶实训报告廊坊安次区网站建设公司
  • jquery插件网站推荐打开网站自动跳转代码
  • 佛山顺德容桂网站制作写作平台
  • 网站源码下载pdf文件品质好房
  • 山网站建设长沙网站开发湖南微联讯点不错
  • 网站建设的方案模板邢台123今天的招聘信息
  • 一个网站做app网站如何做收款二维码
  • 济南seo网站优化网站开发源代码 百度文库
  • 东西湖区建设局网站制作网站需要钱吗
  • 自己买服务器能在wordpress建网站欧美色影网站
  • 网站支付页面设计金华企业网站建设公司
  • wordpress评论模块临沂seo网站管理
  • 四川法制建设网站产品推广步骤
  • 服务器 网站建设比较容易做流量的网站
  • 网站建设基础实训报告天津滨海新区地图全图
  • 兰西网站建设深圳58同城招聘网
  • 兰州网站建设程序烟台赶集网网站建设
  • 自己建立网站后怎么做淘客wordpress需要npv
  • 简单网站建设推荐wordpress主题ashley
  • 单页网站开发实例下载电商营销渠道有哪些
  • 沈阳科技网站首页东营市做网站
  • 网站移动端开发公司客户评价网站建设