In article <GJj8d.14320$(E-Mail Removed)>,
RR <(E-Mail Removed)> wrote:
>"Howard Johnson" <(E-Mail Removed)> wrote in message
>news:cjrtpj$cn1$(E-Mail Removed)...
>> This is not sufficient to provide fair service if batches arrive faster
>> than they can be processed.
>
>Thanks for your reply. But, I can't see how that could be correct....
>
>In the linux 2.4 kernel, the accept queue is strictly FIFO (from what I can
>see).
Fairness has to be ensured at *every* network protocol layer, *including*
the application. I trust that Linux 2.4 kernels process packets fairly.
But there are a number of things applications can do to prevent clients
from being served fairly. Lower-level protocols cannot be discussed in
the abstract without considering higer-level protocol (your application's)
implementations.
>Do you agree? Am I missing some part of the logic?
One of my favorite answers to these kinds of questions is to say that
there is not enough information to give you a definitive answer. And I've
had over 10 years of professional experience diagnosing network protocol
problems.
>BTW, do you know of any easy way to view the kernel's accept queue (I guess
>I could write a prog that reads it in /dev/kmem) in real time?
No. And it's not possible for a user-mode program in a preemptive-
scheduled OS like Linux to read /dev/kmem in real time. It's better to
put trace information in your application anyway.
Good events to log and/or trace include:
* when a client connection is accepted,
* when beginning to receive a client message,
* when each TCP read() is complete,
* when a message is completely received,
* when beginning processing a message,
* and when done processing a message.
Include millisecond-resolution timestamps, socket numbers, message IDs, etc.
However, the easiest way to get reliable information is to collect a
packet trace (really, ethereal is your friend) on the *server* machine.
There is enough information to correctly diagnose these problems in
perhaps half of all cases, in my experience. And for those problems that
aren't diagnosed, it usually does a good job of pointing you in the right
direction.
|