views:

2983

answers:

6

I need to know about Epoll On linux System.

Could you recommend manual or guides about epoll library?

need more detailed guides. it's better to have some examples.

help me. and Thank you for reading.

+4  A: 

Here's an introduction to Epoll, a pretty basic tutorial: http://blog.kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/

Also, the man pages: http://man-wiki.net/index.php/4:epoll

Ryan Guest
A: 

I have used epoll() extensively, and it's great. I have tested it with 128K active sockets, and it performs extremely well.

If you have any specific questions, please ask.

Martin Del Vecchio
Thank you.You did great job!! 128k sockets!! awesome!Can you tell me any comment or sample how to accept 128k active sockets?ps : It's too long to answer. I am sorry.
Simon Kim
A: 

Here is a runnable exaple of epoll : http://www.csplayer.org/2009/02/a-tutorial-example-of-epoll-usage/

Broken link....
rmk
A: 

Is this still active?

Martin, are you around to help?

Rij
+1  A: 

Hi there...

Can anyone please help me to answer the questions about epoll_wait.

  1. Is it overkill to use many threads that call epoll_wait on the same fds set to serve at about 100K active sockets? or will it just be enough to create only 1 thread to perform epoll_wait?

  2. How many threads will wake up from epoll_wait when for example only one socket is ready to read data? i mean, can there be situation when 2 or more threads will wake up from epoll_wait but will have same fds in resulted events?

  3. What is the best way to organize threads in server that works with many active clients (e.g. 50K+). The best way i think is: 1 I/O Worker Thread which perfroms epoll_wait and i/o operations. + Many Data processing threads which will process the data received from I/O worker thread (can take a long time, such as any game logic) and compose new data for I/O worker thread to send to client. Am I right in this approach, or can anyone help me to find out the best way to organize this?

Thanks in advance, Valentin

Valentin
A: 

on thread for waiting for sockets, multiple threads for handling, if that is indeed a bottleneck. if you are handling 100k+ sockets at once, a thread pool is the way to go.