解决Linux中Too many open files问题
1、相关命令:
ulimit –a //查看当前设置
ulimit –n 2048 //即设成2048,按实际需要设置
2、用户环境参数文件配置:
在/etc/profile中加入如下内容:
if
[ $SHELL
=
"
/bin/ksh
"
]; then
ulimit
-
p
16384
ulimit
-
n
65536
else
ulimit
-
u
16384
-
n
65536
fi
3. 修改 /etc/security/limits.conf文件中设置最大打开文件数
添加如下这行。
* - nofile 30000
这行设置了每个用户的默认打开文件数为30000。注意"nofile"项有两个可能的限制措施。就是项下的hard和soft。要使修改过得最大打开文件数生效,必须对这两种限制进行设定。 如果使用"-"字符设定, 则hard和soft设定会同时被设定。
* hard nofile 65535
* soft nofile 65535
相关文档:
Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......
[root@ns1 opt]# du -h -s /* | sort
12K /mnt
13M /sbin
16K /lost+found
1.8G /usr
194M /root
22G /opt
24K /tmp
4.0K&n ......
采用glimpse可以对源代码进行索引,这样在繁杂的代码里面,可以很快的找到关键字。
这个工具就是glimpse。使用方法就不多说了。可以查google嘛! ^__^
采用tee命令可以将glimpse查找出来的信息转存为文件。
就是这样:
glimpse CONFIG_BOOTDELAY | tee bootdelay.txt
这样就查出了所有CONFI ......
/***********************************
*
*client.c
*
**********************************/
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<sys/socket.h>
#include<sy ......
class CTimeTickCount
{
public:
CTimeTickCount(int threadIndex, int id )
{
struct timezone tz;
gettimeofday(&m_tvStartTime, &tz);
// m_tmStartTime = ACE_OS::gettimeofday();
m_iThreadIndex ......