上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: php的引用(就是在变量或者函数、对象等前面加上&符号)在PHP 中引用的意思是:不同的名字访问同一个变量内容。与C语言中的指针是有差别的.C语言中的指针里面存储的是变量的内容,在内存中存放的地址。1.变量的引用2.函数的引用传递(传址调用)"; echo $b;//输出101?>3.函数的引用返... 阅读全文
posted @ 2013-11-06 15:05 rorshach 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Nginxis an open-source Web Server. It is a high-performance HTTP server that uses very low server resources, is reliable and integrates beautifully w... 阅读全文
posted @ 2013-10-24 18:37 rorshach 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 一、一般来说nginx配置文件中对优化比较有作用的为以下几项:1. worker_processes 8;nginx 进程数,建议按照cpu 数目来指定,一般为它的倍数 (如,2个四核的cpu计为8)。2. worker_cpu_affinity 00000001 0000001000000100... 阅读全文
posted @ 2013-10-24 18:26 rorshach 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 安装脚本分析工具wget http://www.day32.com/MySQL/tuning-primer.shchmod +x tuning-primer.sh./tuning-primer.sh和mysqlreport一样,tuning-primer.sh也支持.my.cnf 阅读全文
posted @ 2013-10-24 01:10 rorshach 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1.防火墙开启service iptables start2.防火墙关闭service iptables stop3.防火墙规则保存service iptables save4.防火墙状态service iptables status5.防火墙规查看iptables -L -n6.防火墙规则清除ip 阅读全文
posted @ 2013-10-20 12:21 rorshach 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 一.不停止mysql的情况下安装SphinxSE1.确定mysql版本,下载对应源码包此处下载5.1.69的mysql源码包#wget ftp://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.1/mysql-5.1.69.tar.gz解压2.下载sphin... 阅读全文
posted @ 2013-10-18 18:57 rorshach 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 一.Server端 CentOS 6下安装yum -y install xinetd1.配置:vi /etc/xinetd.d/rsyncservice rsync{ disable = yes socket_type = stream wait = no user = root server = 阅读全文
posted @ 2013-10-16 01:31 rorshach 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一.nfs服务端 1.CentOS6安装nfs-utils和rpcbind两个软件包 2.编辑/etc/exports加入: 将/nfsdir目录共享给192.168.1.107这台服务器服务器,可进行读写操作,并且写操作采用同步方式.NFS主要有3类选项:访问权限选项 设置输出目录只读:ro 设置 阅读全文
posted @ 2013-10-14 23:36 rorshach 阅读(194) 评论(0) 推荐(0) 编辑
摘要: http段配置:#cache configclient_body_buffer_size 512k;proxy_connect_timeout 5;proxy_read_timeout 60;proxy_buffer_size 16k;proxy_buffers 4 64k;proxy_busy_... 阅读全文
posted @ 2013-10-14 08:34 rorshach 阅读(236) 评论(0) 推荐(0) 编辑
摘要: webbench最多可以模拟3万个并发连接去测试网站的负载能力wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gztar zxvf webbench-1.5.tar.gzcd webbench-1.5make && ma... 阅读全文
posted @ 2013-10-13 20:39 rorshach 阅读(140) 评论(0) 推荐(0) 编辑
摘要: fastcgi响应http请求的结果中,响应头包括Expires、Cache-Control、Set-Cookie三个,都会可能不被cache.thinkphp3.0禁止session自动启动config.php中配置'SESSION_AUTO_START' => FALSE,更详细的论述在:h... 阅读全文
posted @ 2013-10-13 12:19 rorshach 阅读(185) 评论(0) 推荐(0) 编辑
摘要: nginx的proxy_cache是缓存后端内容,而fastcgi_cache则是缓存Nginx+php的fastcgi,即缓存php动态内容.fastcgi_cache默认已包含在nginx0.7.48及以后的版本中了.配置:http段中配置fastcgi_cache_path /home/ca... 阅读全文
posted @ 2013-10-13 12:00 rorshach 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 一、介绍Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为“engine X”, 是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服务器.二、Location语法语法:location [=|~|~*|^~] /uri/ { … }注... 阅读全文
posted @ 2013-10-13 10:39 rorshach 阅读(285) 评论(0) 推荐(0) 编辑
摘要: location匹配的原型是这样的:location[=|~|~*|^~|@] /uri/ { … }“=”是精确匹配“@”是命名的location,在正常的location匹配中不会使用,仅仅在内部跳转中才会使用到。“~”是区分大小写的匹配“~*”是不区分大小写的匹配“^~”表示中止正则匹配(这... 阅读全文
posted @ 2013-10-13 10:22 rorshach 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Amoeba安装及读写分离配置一.amoeba简介官网:http://docs.hexnova.com/amoeba/index.html二.Centos下安装jdk1.yum 安装1.6版本jdk2.设置系统变量#vi /etc/profile在最末端增加以下内容export JAVA_HOME... 阅读全文
posted @ 2013-10-05 21:26 rorshach 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 一.基本规划负载均衡调度器 192.168.1.104 默认网关 192.168.1.1 ip别名 192.168.1.233realserver1 192.168.1.102 默认网关 192.168.1.1 ip别名 192.168.1.233realserver2 192.168.1.105... 阅读全文
posted @ 2013-10-04 20:23 rorshach 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 一.基本规划VIP:192.168.1.11Master:192.168.1.105Backup:192.168.1.102二.安装主备分别安装keepalivedyum -y install keepalived三.Master配置#vi /etc/keepalived/keepalived.co 阅读全文
posted @ 2013-10-04 10:51 rorshach 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 1.yum安装wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -ivh epel-release-6-8.noarch.rpmyum install -y haproxy2.配置文件... 阅读全文
posted @ 2013-10-03 16:23 rorshach 阅读(186) 评论(0) 推荐(0) 编辑
摘要: LVS的优点:1、抗负载能力强、工作在第4层仅作分发之用,没有流量的产生,这个特点也决定了它在负载均衡软件里的性能最强的;无流量,同时保证了均衡器IO的性能不会受到大流量的影响;2、工作稳定,自身有完整的双机热备方案,如LVS+Keepalived和LVS+Heartbeat;3、应用范围比较广,... 阅读全文
posted @ 2013-10-03 10:07 rorshach 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 一.Centos下安装Redis1.wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm2.rpm -ivh epel-release-6-8.noarch.rpm 3.yum install r 阅读全文
posted @ 2013-10-02 01:55 rorshach 阅读(244) 评论(0) 推荐(0) 编辑
摘要: TCMalloc(Thread-Caching Malloc)是google-perftools工具中的一个,与标准的glibc库的malloc相比,TCMalloc在内存的分配上效率和速度要高得多,可以提高Mysql服务器在高并发情况下的性能,降低系统负载.该项目地址为:https://code... 阅读全文
posted @ 2013-10-01 16:55 rorshach 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 一.下载mysql-cluster从mysql官网下载对应的mysql-cluster二.配置管理节点1.解压mysql-cluster,找到解压文件中的ndb_mgm和ndb_mgmd2.复制到/usr/local/bin目录下cp ndb_mgm /usr/local/bincp ndb_mg... 阅读全文
posted @ 2013-09-29 14:44 rorshach 阅读(529) 评论(0) 推荐(0) 编辑
摘要: Linux 包括 CentOS 下高可用性(HA:High Availability)集群方案很多,而 Heartbeat 是比较常见和性价比比较高的一种。一、硬件及网络连接 群集一般需要2台以上服务器,本篇以两台服务器做群集(双机热备)为例来说明。本实验在 Vmware Workstation ... 阅读全文
posted @ 2013-09-26 09:32 rorshach 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 很多人通过 binlog-do-db, binlog-ignore-db, replicate-do-db 和 replicate-ignore-db 来过滤复制(某些数据库), 尽管有些使用, 但是,在我看来,他们是危险的,并且他们被滥用了. 对于很多的实例,有更安全的替换方案 为什么危险很简单: 阅读全文
posted @ 2013-09-25 09:58 rorshach 阅读(7209) 评论(2) 推荐(0) 编辑
摘要: author:skatetime:2012/03/08MySQL高可用解决方案1.主备模式:master/slave2.级联主备模式:A->B->C3.mysql双主MMM模式4.hearbeat/san,hearbeat/BRBD模式5.NDB cluster模式这里只讲配置,具体的适合应用场景... 阅读全文
posted @ 2013-09-25 01:58 rorshach 阅读(197) 评论(0) 推荐(0) 编辑
摘要: FLUSH TABLES WITH READ LOCK 这个命令是全局读锁定,执行了命令之后所有库所有表都被锁定只读。一般都是用在数据库联机备份,这个时候数据库的写操作将被阻塞,读操作顺利进行。 用于在线备份数据库,防止备份期间数据被写入.解锁的语句也是unlock tables。 2.LOCK ... 阅读全文
posted @ 2013-09-25 00:31 rorshach 阅读(879) 评论(0) 推荐(0) 编辑
摘要: 浏览器缓存主要有两类 缓存协商:Last-midified ,Etag 彻底缓存:cache-control,Expires 缓存协商的意思是需要去服务器端询问页面有没有修改过,没有修改过则返回304直接使用缓存内容,否则返回新内容 协商步骤: 服务器发送带Last-midified:GMTtim... 阅读全文
posted @ 2013-09-21 21:10 rorshach 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 负载均衡服务器将会用到两块网卡,eth0为公网地址(此处将局域网ip作为公网地址),IP地址为192.168.1.104,eth0:1,IP地址为192.168.2.1在负载均衡器上添加一个ip别名,用于测试ifconfig eth0:1 192.168.2.11.修改负载均衡器的/etc/sys... 阅读全文
posted @ 2013-09-21 10:32 rorshach 阅读(165) 评论(0) 推荐(0) 编辑
摘要: nginx配置支持memcache,但不支持写,支持读,所以读取部分由程序设置,整个代码如下nginx的server段配置如下:#将静态文件放入memcachelocation ~* \.(gif|jpg|jpeg|png|bmp|swf|css|js)$ { root /usr/share/ng... 阅读全文
posted @ 2013-09-20 11:41 rorshach 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1.使用nginx -V确定nginx的编译参数2.下载nginx源码3.下载nginx的扩展模块(此处为memcache模块)4.进入nginx源码目录5../configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-pat... 阅读全文
posted @ 2013-09-20 11:26 rorshach 阅读(195) 评论(0) 推荐(0) 编辑
摘要: kill -HUP cat /usr/local/nginx/logs/nginx.pid` 阅读全文
posted @ 2013-09-16 22:04 rorshach 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 在http段中进行全局配置,也可以在server段中进行局部配置gzip on;gzip_min_length 1100;//不压缩小于该值的数据,单位为bgzip_types text/plain application/x-javascript text/css application/xml... 阅读全文
posted @ 2013-09-16 22:02 rorshach 阅读(156) 评论(0) 推荐(0) 编辑
摘要: varnish不缓存cookie的页面,如果html页面中带有cookie以下代码为接收到结尾的文件,自动去除掉cookiesub vcl_recv { if (req.request == ”GET” && req.url ~ ”\.(js|css|html|jpg|png|gif|swf|jp... 阅读全文
posted @ 2013-09-16 02:12 rorshach 阅读(851) 评论(0) 推荐(0) 编辑
摘要: 打包文件同时压缩tar -zcvf /file.tar.gz /directoryname 阅读全文
posted @ 2013-09-16 00:47 rorshach 阅读(204) 评论(0) 推荐(0) 编辑
摘要: yum install php-eaccelerator 阅读全文
posted @ 2013-09-16 00:45 rorshach 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络.#运行用户user www-data; #启动进程,通常设置成和cpu的数量相等worker_processes 1;#全局错误日志及PID文件error_log /var/log/nginx/error.log;... 阅读全文
posted @ 2013-09-12 10:23 rorshach 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.安装nginx2.在nginx.conf的http区段中配置负载均衡段#cluserupstream myCluster{server 192.168.1.110:1300 weight=5;#server 192.168.1.110:8040;}#轮询负载,5/6的几率访问到192.168.1 阅读全文
posted @ 2013-09-11 01:31 rorshach 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 保证主库和从库数据库数据一致mysql主库MASTER配置(在my.cnf中加入以下配置):log-bin=master-binbinlog-do-db=test #需要同步的数据库名称server-id=11进行授权:grant replication slave on *.* to 'repl... 阅读全文
posted @ 2013-09-06 00:55 rorshach 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 备份命令:mysqldump-uroot-p--opt数据库名>/data/数据库文件名.sql恢复命令:mysql-uroot-p数据库名</data/恢复的数据库文件 阅读全文
posted @ 2013-06-29 01:27 rorshach 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 为了使缓存里的数据不丢失,之前先运行一下以下命令sync#Tofreepagecache:echo1>/proc/sys/vm/drop_caches#Tofreedentriesandinodes:echo2>/proc/sys/vm/drop_caches#Tofreepagecache,de... 阅读全文
posted @ 2013-03-05 17:07 rorshach 阅读(180) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页