我是非常新的APC缓存与PHP。下面是我为提供动态页面的nginx/php 4GB服务器提供的当前设置--4GB RAM。
我需要启用“用户缓存”吗?因为它似乎没有被使用。
另外,任何人都可以对这些设置提供任何建议吗?我目前正在阅读、学习和尝试调整这些设置,但任何建议都将不胜感激。thx
注意:设置没有php.ini (我认为这是标准的)。
General Cache Information
APC Version 3.1.15-dev
PHP Version 5.4.23
Server Software nginx/1.4.4
Shared Memory 1 Segment(s) with 64.0 MBytes
(mmap memory, pthread mutex Locks locking)
Start Time 2014/01/04 05:04:13
Uptime 22 minutes
File Upload Support 1
File Cache Information
Cached Files 13 (483.2 KBytes)
Hits 51655
Misses 18
Request Rate (hits, misses) 38.71 cache requests/second
Hit Rate 38.69 cache requests/second
Miss Rate 0.01 cache requests/second
Insert Rate 0.01 cache requests/second
Cache full count 0
User Cache Information
Cached Variables 0 ( 0.0 Bytes)
Hits 0
Misses 0
Request Rate (hits, misses) 0.00 cache requests/second
Hit Rate 0.00 cache requests/second
Miss Rate 0.00 cache requests/second
Insert Rate 0.00 cache requests/second
Cache full count 0
Runtime Settings
apc.cache_by_default 1
apc.canonicalize 1
apc.coredump_unmap 0
apc.enable_cli 0
apc.enable_opcode_cache 1
apc.enabled 1
apc.file_md5 0
apc.file_update_protection 2
apc.filters
apc.gc_ttl 3600
apc.include_once_override 0
apc.lazy_classes 0
apc.lazy_functions 0
apc.max_file_size 2M
apc.mmap_file_mask /tmp/apc.vaREsm
apc.num_files_hint 1024
apc.preload_path
apc.report_autofilter 0
apc.rfc1867 0
apc.rfc1867_freq 0
apc.rfc1867_name APC_UPLOAD_PROGRESS
apc.rfc1867_prefix upload_
apc.rfc1867_ttl 3600
apc.serializer igbinary
apc.shm_segments 1
apc.shm_size 64M
apc.shm_strings_buffer 8M
apc.slam_defense 0
apc.stat 1
apc.stat_ctime 0
apc.ttl 7200
apc.use_request_time 1
apc.user_entries_hint 4096
apc.user_ttl 7200
apc.write_lock 1发布于 2014-01-05 23:42:36
首先,您应该了解什么是用户缓存,以决定是否应该启用它。用户缓存意味着将数据(保存数据)缓存到APC中。现在这可能是一个对象,任何变量。
假设您从数据库中获取用户配置文件,并且您希望缓存它,这样下一个请求就不需要从db获取。您将在第一次从db获取之后将其缓存在APC中。这是一个示例,可以在其中使用APC用户缓存。
$userObject->name = "Mike";
$userObject-> age = 12;
apc_store("user", $userObject);您可以使用用户的键检索值。
var_dump(apc_fetch("user"));THats用户缓存
看看这个关于完美的APC配置的站点:
完善的APC配置
https://stackoverflow.com/questions/20940581
复制相似问题