神秘果 on 四月 7th, 2010

Linux下当程序crash时,会产生core文件,记录程序非正常退出时的内存映象,通过gdb可以加载core文件可调试跟踪程序出错的代码所在行。

Read the rest of this entry »
神秘果 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 十月 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 »
神秘果 on 九月 17th, 2009
定义
代理(Proxy)模式,为其他对象提供一种代理以控制对这个对象的访问。
  Read the rest of this entry »
神秘果 on 九月 16th, 2009

定义

享元(Flyweight)模式是指,运用共享技术有效地支持大量细粒度的对象。
Read the rest of this entry »
神秘果 on 九月 14th, 2009

定义

为子系统中的一组接口提供一个一致的界面,外观(Facade)模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。
Read the rest of this entry »