Apache:
现在可以处理每秒大概3W个UDP包了,但再也上不去了,请大牛们帮忙分析一下可能是什么原因呢?
[阅读: 878] 2010-06-24 08:16:28
CPU 只占用了 50%
和系统内部的什么机制有关么?导致不能响应更多的UDP包
我现在用如下做法来收包,是不是有更好的方法,比如多个线程 Accept
while(true){
resize = recvfrom(sockfd, buf, sizeof(buf)-1, 0,
(struct sockaddr *)&their, &the_len);
}