The comparison between select and Epoll is not to say much. The ACE uses Select to implement reactor under Linux by default. How to let ace use Epoll under Linux.
1. Add a compiler macro that tells the ACE not to use the default select, but to use Event_poll.
2. Then recompile the project for the ace.
3. When used in your program:
"Ace/dev_poll_reactor.h" //system to open the file limit for each process, Ulimit-n Ace_reactor Reactor (&dev_reactor); //4000 for maximum number of open Ace_reactor::instance (&reactor);
4. Recompile your program to
You may encounter the following error:
Error:Ace_dev_poll_reactor::open failed inside Ace_dev_poll_reactor::ctor:
This is some of the limitations of Linux and can be configured with new values. The maximum number of descriptors that can be processed by the Epoll is limited by the maximum number of descriptors that can be opened by the user, usually by default of 1024, available ulimit-a view,
Two methods of modification:
1.ulimit-n 5120 #每次登录到shell都要修改, only valid for this login.
2. Modify the/etc/security/limits.conf with the root user, add the following two lines, and then log in again. is globally valid after the repair configuration file.
* Soft nofile 5120* hard nofile 10240
Linux under Ace using Epoll