About ACE "Max Number of AIOs 1024" problem under Linux.
来源:互联网 发布:女主播播放软件 编辑:程序博客网 时间:2024/05/17 05:18
This problem comes from POSIX_Proactor.cpp, line 970. The default max number of AIO of linux is 1024. By running command "ulimit -n", we can get this value.
The resolution is simple, according to this article. We have to modify several files to break the limit of system.
1. edit /etc/security/limits.conf, set the limit for the user/group who want to break the limit, such as:
...igamesoftnofile4096igamehardnofile4096# End of file
2. edit /etc/pam.d/common-session and /etc/pam.d/common-session-noninteractive, add the following lines:
...session requiredpam_limits.so# end of pam-auth-update config
Now, reboot and run "ulimit -n", we will get a value of 4096.
Next step, we have to modify ACE source code.
1. Edit ace/POSIX_Proactor.h, replace line 36, 37 with the following code:
// igame update the max size to 4096, default size to 1024//#define ACE_AIO_MAX_SIZE 2048//#define ACE_AIO_DEFAULT_SIZE 1024#define ACE_AIO_MAX_SIZE 4096#define ACE_AIO_DEFAULT_SIZE 2048#warning("Igame changed the AIO size: max 4096, default 2048")
We doubled the max and default AIO value.
2. If you think the the "Max Number of AIOs xxxx" really annoy, you can search "ACE_POSIX_AIOCB_Proactor::Max Number of AIOs=%d" in ace/POSIX_Proactor.h and comment the respective lines.
3. make clean && make and then install.
Note if you want to install libACExxx into /usr, you should run "make install" in $ACE_ROOT with root's shell.
Now we can re-compile our program and run it. If we didn't comment the tip, we will get output like this:
(17066 | 140737320802048) ACE_POSIX_AIOCB_Proactor::Max Number of AIOs=2048
- About ACE "Max Number of AIOs 1024" problem under Linux.
- Number of Under-Replicated Blocks问题
- namenode Number of Under-Replicated Blocks
- ZOJ Problem Set - 3869||Ace of Aces
- About how to build PJSIP under linux environment
- The usage of grep under LINUX systems.
- the equivalent of _vscprintf && _vscwprintf under Linux
- err max number of clients reached 解决办法
- err max number of clients reached 解决办法
- Set privilege of folder under Apache of Linux
- Max number of threads (maxWaitQueueSize) of 500 has been exceeded
- [LeetCode]problem 191. Number of 1 Bits
- Problem 21 of Evaluate the sum of all the amicable numbers under 10000.
- Problem 14 - Find the longest sequence using a starting number under one million.
- Problem about the Format of Title-in Interactive Reporting
- the method of resolving the difficult problem about sap
- HDU 1492 The number of divisors(约数) about Humble Numbers
- The number of divisors(约数) about Humble Numbers
- 几个java小程序
- 两个数据库的小题
- 关于URL重写、session,cookie
- 接下来准备学的东西
- Java之静态内部类
- About ACE "Max Number of AIOs 1024" problem under Linux.
- 更改git remote仓库地址
- Makefile中的隐式规则
- java简单的在线用户统计
- matlab 读取文件各种方法
- java 缓存jcs
- ios layer的一些学习
- IBM AIX相关知识
- 关于八皇后