01. 1.
一直莫名其妙的遇到类似这样错误:connect() to unix:/tmp/php-fcgi.sock failed (11: Resource temporarily unavailable) while connecting to upstream,N久之后才发现了Igor Sysoev的留言。
原文链接:http://marc.info/?l=nginx&m=125423942216521&w=2
> I found that :
>
> #define NGX_LISTEN_BACKLOG 511
>
> and use it as the backlog of listen()
>
> ls.backlog = NGX_LISTEN_BACKLOG;
> if (listen(s, ls.backlog) == -1) {
>
> Does it mean that only 511 connection could be accept at the same time ?
No, it means that up to 511 connections can be queued in kernel listen
queue. 511 is just a safe limit for the most OSes. For FreeBSD it's -1,
i.e., value of sysctl kern.ipc.somaxconn.
> May I modify it to 1024 or higher( I am sure use it less than SOMAXCONN )
listen 80 default backlog=1024;
--
Igor Sysoev
阅读全文 »
12. 2.
直接举例:
shell> fdisk /dev/hda
The number of cylinders for this disk is set to 5221.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
阅读全文 »
12. 1.
一、PPTP 协议介绍
1、PPTP 简介
PPTP: Point to Point Tunneling Protocol
点对点隧道协议(PPTP)是一种支持多协议虚拟专用网络的网络技术。通过该协议,远程用户能够通过 Microsoft Windows NT 工作站、Windows 95 和 Windows 98 操作系统以及其它装有点对点协议的系统安全访问公司网络,并能拨号连入本地 ISP,通过 Internet 安全链接到公司网络。
PPTP 可以用于在 IP 网络上建立 PPP 会话隧道。在这种配置下,PPTP 隧道和 PPP 会话运行在两个相同的机器上,呼叫方充当 PNS。PPTP 使用客户机-服务器结构来分离当前网络访问服务器具备的一些功能并支持虚拟专用网络。PPTP 作为一个呼叫控制和管理协议,它允许服务器控制来自 PSTN 或 ISDN 的拨入电路交换呼叫访问并初始化外部电路交换连接。
PPTP 只能通过 PAC 和 PNS 来实施,其它系统没有必要知道 PPTP。拨号网络可与 PAC 相连接而无需知道 PPTP。标准的 PPP 客户机软件可继续在隧道 PPP 链接上操作。
PPTP 使用 GRE 的扩展版本来传输用户 PPP 包。这些增强允许为在 PAC 和 PNS 之间传输用户数据的隧道提供低层拥塞控制和流控制。这种机制允许高效使用隧道可用带宽并且避免了不必要的重发和缓冲区溢出。PPTP 没有规定特定的算法用于低层控制,但它确实定义了一些通信参数来支持这样的算法工作。
阅读全文 »
11. 25.
Everything was smooth before i upgrade VirtualBox to version 3.0.12, i can not install a 64bit os, even unables to startup a installed os base on 64bit.
The screen show the error message "NMI Watchdog detected LOCKUP", and i found this via google:
http://forums.virtualbox.org/viewtopic.php?f=3&t=24832
and a guy called kevin.clevenger gave the solution:
Setting the kernel parameter nmi_watchdog=0 (as suggested in another post) works around the issue and gets the client booted. I do not consider this to be a fix however.
1) install the CentOS 5.4 x86_64, boot: linux text nmi_watchdog=0
2) startup the OS, when you see boot loader then press "a" to modify the default boot, add nmi_watchdog=0 in the end, continue booting. this change is only okay for the current boot, so i suggest editing the "/boot/grub/grub.conf", and add the "nmi_watchdog=0" at the end of the line witch looks like: kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 nmi_watchdog=0
11. 8.
There is no Zend Optimizer for PHP 5.3 currently, so php codes encrypted with Zend Guard do not work.
Zend has promised a new version of Zend Optimiser and Zend Guard for PHP 5.3 later this year. But there is a catch, because of compatibility problems apps encrypted with older Zend Guard versions will probably not work with PHP 5.3 .
source: http://forums.zend.com/viewtopic.php?f=57&t=1365
10. 13.
姓名:周星君
年龄:1.8岁
Title: my cuttttte son!
Location: rental housing in beijing
Cameraman: Kimi & hao32
Date & Time: 2009-10-12 at Night
阅读全文 »
10. 2.
某台前端服务器发现iconv函数数据输出为空。其他前端则输出正常;系统版本和安装的软件包都是一样;经过分析基本判断为gd库和iconv的冲突问题只要php编译中加入gd库支持就会导致这一情况。
但是在前端服务器里面缺完全没有这个问题,看来只是针对特定硬件出现的问题。解决方法是把gd或者iconv作为作为动态模块加载,总之避免gd和iconv同时使用静态方式编译就行。
php动态方式加载gd编译方法
首先安装好gd
假设gd是安装在/usr/local/gd,php是安装在/usr/local/php
cd /usr/local/src/php-5.2.8/ext/gd/
/usr/local/php/bin/phpize
./configure --with-gd=/usr/local/gd --with-php-config=/usr/local/php/bin/php-config
make && make install
09. 24.
key_buffer_size - 这对MyISAM表来说非常重要。如果只是使用MyISAM表,可以把它设置为可用内存的 30-40%。合理的值取决于索引大小、数据量以及负载。
记住,MyISAM表会使用操作系统的缓存来缓存数据,因此需要留出部分内存给它们,很多情况下数据比索引大多了。尽管如此,需要总是检查是否所有的 key_buffer 都被利用了。
.MYI 文件只有 1GB,而 key_buffer 却设置为 4GB 的情况是非常少的。这么做太浪费了。如果你很少使用MyISAM表,那么也保留低于 16-32MB 的 key_buffer_size 以适应给予磁盘的临时表索引所需。
innodb_buffer_pool_size - 这对Innodb表来说非常重要。Innodb相比MyISAM表对缓冲更为敏感。MyISAM可以在默认的 key_buffer_size 设置下运行的可以,然而Innodb在默认的 innodb_buffer_pool_size 设置下却跟蜗牛似的。由于Innodb把数据和索引都缓存起来,无需留给操作系统太多的内存,因此如果只需要用Innodb的话则可以设置它高达 70-80% 的可用内存。如果你的数据量不大,并且不会暴增,那么无需把 innodb_buffer_pool_size 设置的太大了。
innodb_additional_pool_size - 这个选项对性能影响并不太多,至少在有差不多足够内存可分配的操作系统上是这样。不过如果你仍然想设置为 20MB(或者更大),因此就需要看一下Innodb其他需要分配的内存有多少。
08. 24.
1、隔壁那小子终于发誓要减肥了——毕业招聘会上,有人对他说了句:“哥们,让一下,你挡着我的手机信号了。”
2、雷锋做了好事不留名,但是每一件事情都记到日记里面。
4、逃课太多,昨天想去上课,见到教授,教授惊讶地说,这么长时间不见,长这么大了。
5、我左青龙,右白虎,肩膀纹个米老鼠。
6、每当我错过一个女孩,我就在地上放一块砖,于是便有了长城。
7、鸳鸯戏水,都TM淹死;比翼双飞,都TM摔死。
8、纯,属虚构,乱,是佳人。
9、幸福就是痒的时候挠一下,不幸就是痒了但挠不着,更不幸的是,很久以来灵魂和肉体都感觉不到那种蠢蠢欲动的痒了。
10、我虽然做不了有钱人的后代,但我一定要做有钱人的祖宗。
11、天没降大任于我,照样苦我心智,劳我筋骨。
12、谁,执我之手,敛我半世癫狂;谁,吻我之眸,遮我半世流离。
13、众里寻她千百度,蓦然回首,那人依旧对我不屑一顾。
阅读全文 »
hao32