½â¾ö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
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÓɲÙ×÷ϵͳʵÏÖµÄËùÓÐϵͳµ÷ÓÃËù¹¹³ÉµÄ¼¯ºÏ¼´³ÌÐò½Ó¿Ú»òÓ¦Óñà³Ì½Ó¿Ú(Application Programming Interface£¬API)¡£ÊÇÓ¦ÓóÌÐòͬϵͳ֮¼äµÄ½Ó¿Ú¡£
¡¡¡¡²Ù×÷ϵͳµÄÖ÷Òª¹¦ÄÜÊÇΪӦÓóÌÐòµÄÔËÐд´½¨Á¼ºÃµÄ»·¾³£¬ÎªÁË´ïµ½Õâ¸öÄ¿µÄ£¬ÄÚºËÌṩһϵÁо߱¸Ô¤¶¨¹¦ÄܵĵÄÄں˺¯Êý£¬Í¨¹ýÒ»×é³ÆÎªÏµÍ³µ÷Óõģ¨system call)µÄ½Ó¿Ú³ÊÏÖ¸øÓà ......
/******************************
*
* server.c
*
******************************/
#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<errno.h>
#include<string.h>
#include<netinet/in.h>
#include<sys/wait.h> ......
#include <sys/ipc.h>
#include <stdio.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#define PERM IPC_CREAT //S_IRUSR|S_IWUSR
#include <errno.h>
int main(int argc,char **argv)
{
int shmid[2048];
c ......