神秘果 on 二月 28th, 2010

定义

Base6464个可见字符表示任意字节编码方式。
Base64RFC2045section 6.8The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable)定义:Base64内容传送编码被设计用来把任意序列的8位字节描述为一种不易被人直接识别的形式。
相对于Base64,还有Base16Base32编码方式,可以参见RFC3548The Base16, Base32, and Base64 Data Encodings)。
Base64编码应用:电子邮件编码传输、广告点击跳转加密编码串、Cookie串二进制内容编码。
Read the rest of this entry »
神秘果 on 十一月 15th, 2009

Mysql状态变量通过”show global status”(自Mysql上次启动以来的统计)获取,重要的参数包括各种SQL执行频率,索引使用情况、锁资源使用情况等。

长时间运行的Mysql服务器,运行flush status;可以重置一些计数器优化性能。
Read the rest of this entry »
神秘果 on 十一月 11th, 2009

Mysql主从复制是一台服务器充当主服务器,另一台或多台服务器充当从服务器,主机自动复制到从机。对于多级复制,数据服务器即可充当主机,也可充当从机。Mysql复制的基础是主服务器对数据库修改记录二进制日志binlog,从服务器通过主服务器的binlog自动执行更新。

Read the rest of this entry »

神秘果 on 十一月 4th, 2009

TCMallocThread-Caching Malloc)是google-perftools工具中的一个,与标准的glibc库的malloc相比,TCMalloc在内存的分配上效率和速度要高得多,可以提高Mysql服务器在高并发情况下的性能,降低系统负载。

Read the rest of this entry »

神秘果 on 十一月 2nd, 2009

以下是Mysql数据库服务器配置文件/etc/my.cnf的详细配置。应用场合是InnoDB引擎,4CPU 32SUSE

Read the rest of this entry »
神秘果 on 十月 29th, 2009

InnoDB引擎下发现,Mysql的主从热备存在数据不一致的问题,一些数据没有成功同步到备机。在use databases后,更新的表必须是当前选择的database才同步。譬如连上Mysql服务后操作:

Read the rest of this entry »

神秘果 on 十月 27th, 2009

在测试页面并发压力的时候,并发到80以后,响应速度急剧下降,CPU占用率急剧上升。经分析,是Apache并发数和Mysql并发数匹配问题。

Read the rest of this entry »
神秘果 on 十月 27th, 2009

长短连接区别

不同于mysql_connect的短连接,mysql_pconnect持久连接的时候,将先尝试寻找一个在同一个主机上用同样的用户名和密码已经打开的(持久)连接,如果找到,则返回此连接标识而不打开新连接。
Read the rest of this entry »
神秘果 on 十月 27th, 2009

Apache通过多路处理模块Multi-Processing ModuleMPM控制并发,常用的有两种模式:prefork(默认)和worker,通过apachectrl  -l可看到当前加载MPM模块(prefork.c或者worker.c)。

Read the rest of this entry »
神秘果 on 九月 30th, 2009

 Linux下,要想scp自动输入远端服务器的密码来拷贝文件,一般借助expect脚本来达到目的。两台服务器之间互信是指,用scp拷贝文件、ssh登陆、rsync同步文件等操作的时候,不需要输入远端服务器的用户密码就可以完成操作。

Read the rest of this entry »