PHP企业级应用缓存技术详解
ator,apc,phpa,xcache等等。
MySQL缓存 这也算非代码级的,经典的数据库就是用的这种方式,看下面的运行时间,0.09xxx之类的。
[client] …… default-character-set=gbk default-storage-engine=MYISAM max_connections=600 max_connect_errors=500 back_log=200 interactive_timeout=7200 query_cache_size=64M …… table_cache=512 …… myisam_max_sort_file_size=100G myisam_max_extra_sort_file_size=100G myisam_sort_buffer_size=128M key_buffer_size=1024M read_buffer_size=512M …… thread_concurrency=8
基于反向代理的Web缓存 如Nginx,SQUID,mod_PRoxy(apache2以上又分为mod_proxy和mod_cache) NGINX的例子:
#user nobody; worker_processes 4; error_log logs/error.log crit; pid logs/nginx.pid; worker_rlimit_nofile 10240; events { use epoll; worker_connections 51200; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; tcp_nodelay on; # server pool upstream bspfrontsvr { server 10.10.10.224:80 weight=1; server 10.10.10.221:80 weight=1; } upstream bspimgsvr { server 10.10.10.201:80 weight=1; } upstream bspstylesvr { server 10.10.10.202:80 weight=1; } upstream bsphelpsvr { server 10.10.10.204:80 weight=1; } upstream bspwsisvr { server 10.10.10.203:80 weight=1; } upstream bspadminsvr { server 10.10.10.222:80 weight=1; } upstream bspbuyersvr { server 10.10.10.223:80 weight=1; } upstream bspsellersvr { server 10.10.10.225:80 weight=1; } upstream bsploginsvr { server 10.10.10.220:443 weight=1; } upstream bspregistersvr { server 10.10.10.220:80 weight=1; } log_format test_com ‘$remote_addr – $remote_user [$time_local] “$request” ‘ ‘$status $body_bytes_sent “$http_referer” “$http_user_agent” ‘; #——————————————————————– #img.test.com server { listen 10.10.10.230:80; server_name img.test.com; location / { proxy_pass http://bspimgsvr; include proxy_setting.conf; } access_log logs/img.log test_com; } #style.test.com server { listen 10.10.10.230:80; server_name style.test.com; location / { proxy_pass http://bspstylesvr; include proxy_setting.conf; } access_log logs/style.log test_com; } #help.test.com server { listen 10.10.10.230:80; server_name help.test.com; location / { proxy |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |