Re: Socket NKE performance
Re: Socket NKE performance
- Subject: Re: Socket NKE performance
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 6 Jun 2003 12:10:21 +0200
On jeudi, juin 5, 2003, at 19:35 Europe/Paris, Joshua Graessley wrote:
On Thursday, June 5, 2003, at 7:33, Stiphane Sudre wrote:
I'm testing what kind of performance I can get from a Socket NKE
communication from a Kernel Extension to a user land application.
I set the recv_space of the socket to be 224 KB in the Kernel
In the application, I'm using a CFSocket to read the data when
available.
To communicate with the application I'm sbappending 32 Bytes data
using the same kind of code that the NKE tcpdumper sample code.
My unrealistic dream is to reach a peak of 1 MB/s. But 300 KB/s would
already be fair.
From the test I'm making, the performance can just reach 25 KB/s. Is
this not a bit weak compared to what should be expected?
Is there a reason you're only writing 32 bytes at a time?
Because I have to as the function may not be called anew for a while.
And the "message" I need to send is 32 bytes long.
Are you calling sorwakeup after each time that you write 32 bytes?
Yes.
I may need to clarify where I'm getting the 25 KB/s result from.
Before the sbappend, sorwakeup calls, I have a test like this:
freeSpace=sbspace(&_NKESocket->so_rcv);
if (freeSpace < (32*sizeof(char))
{
printf("No more space. (only %ld byte(s) available)\n",freeSpace);
return;
}
...
p = m->m_data;
p = (char *)(((int)p+3)&(~0x3));
m->m_data = (caddr_t)p;
bcopy(&tData, mtod(m, caddr_t), (32*sizeof(char)));
m->m_len = (32*sizeof(char));
m->m_flags |= M_EOR;
sbappend(&_NKESocket->so_rcv, m);
sorwakeup(_NKESocket);
To simplify, this procedure may get call for every networking packet
received or sent.
To test the performance of this, from another machine, I'm getting some
html files at a rate of 100 per seconds (using http_load).
This leads to maybe more than 1000 packets being sent from my machine
per second.
What I'm seeing in the user land is that I'm only receiving 700-800
'messages' per second from the Kernel and that in the same time I'm
seeing many "No more space. (only 0 byte(s) available)" in system.log
per second.
So doing a quick and may be stupid computing this gave me: 800 * 32
bytes /s 25,600 Bytes/s
What I don't understand is since i have a so_rcv of 224 KB, I would
have thought that I could get more than 25 KB/s.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.