List Info

Thread: Re: Proposal: socketfrom()




Re: Proposal: socketfrom()
country flaguser name
United Kingdom
2007-07-05 01:54:50
On Thu, Jul 05, 2007 at 01:38:05AM -0400, Thor Lancelot
Simon wrote:
> I have an application that makes outbound TCP
connections at a very high
> rate, so high that the overhead of additional system
calls to set socket
> options considerably impacts performance.

That sounds as though there is something badly wrong in the
code
paths somewhere.
Even allowing for the system calls costs, I'm surprised
that
setsockopt() gets anywhere near the cost of connect().

	David

-- 
David Laight: davidl8s.co.uk

Re: Proposal: socketfrom()
country flaguser name
Canada
2007-07-05 02:02:15
>> I have an application that makes outbound TCP
connections at a very
>> high rate, so high that the overhead of additional
system calls to
>> set socket options considerably impacts
performance.
> That sounds as though there is something badly wrong in
the code
> paths somewhere.

Maybe, but I'm not so sure.

> Even allowing for the system calls costs, I'm surprised
that
> setsockopt() gets anywhere near the cost of connect().

Some processors make crossing the kernel/user boundary very
expensive.
That crossing can be a substantial portion of the cost of a
call such
as setsockopt() - or even connect(), especially async
connect() (which
is probably what's going on).

Upon considering that Thor's code was probably doing at
least a
half-dozen setsockopt() calls for each socket, I find it
totally
plausible that doing (say) eight syscalls instead of two for
each
connection could "considerably" impact
performance.

/~ The ASCII				der Mouse
 / Ribbon Campaign
 X  Against HTML	       mouserodents.montreal.qc.ca
/  Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3
27 4B

Re: Proposal: socketfrom()
country flaguser name
United States
2007-07-05 10:18:48
On Jul 4, 2007, at 11:54 PM, David Laight wrote:

> On Thu, Jul 05, 2007 at 01:38:05AM -0400, Thor Lancelot
Simon wrote:
>> I have an application that makes outbound TCP
connections at a very  
>> high
>> rate, so high that the overhead of additional
system calls to set  
>> socket
>> options considerably impacts performance.
>
> That sounds as though there is something badly wrong in
the code
> paths somewhere.
> Even allowing for the system calls costs, I'm surprised
that
> setsockopt() gets anywhere near the cost of connect().

Lots and lots of calls?

>
>
> 	David
>
> -- 
> David Laight: davidl8s.co.uk

-- thorpej


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )