LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-17-2009, 05:28 AM   #1
aditya.pipersenia
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
Question splice ( ) not giving performance gains over sendto( )


Hii

I am doing some experimentation work on the splice ( ) system call. My hardware <b>does not support Scatter-Gather DMA</b>. I have 2 server applications for transmiiting data over the network using TCP. In both the applications a socket is opened, binded to a port and after listening on the port, accepts a connection from the client side. I connect to the server side from another linux box on the same network. Both open a /dev/zero file of the required size for sending over the network. Now, the difference between the two lies in the mechanism used for transmitting the file over the network.

1). One application uses a combination of <b>read( )/sendto( ) system calls </b>i.e.
<b>
read( ) -> to read contents of the file and
sendto( )-> to send the read contents to the connected socket (client side).
</b>
2). The other application uses the <b>'splice mechanism'</b> for sending the data. i.e.
<b>
splice( )-> the data from the file into a pipe and then another
splice( )-> to send the contents fo the pipe to the connected socket (client side)
</b>
Though i am not noticing any data loss in transmitting the file over the network, the times taken for both the applications are around the same. i.e. I am not observing any throughput gains when using <b>splice( ) over read( )/sendto( )</b>.

I am wondering if <b>splice( ) </b> gives performance gains only when the hardware supports Scatter-Gather DMA or there is some other problem. I would be grateful to anybody who can shed some light on the above observations.

Cheers

Aditya

PS: I had earlier posted a thread which discussed the problem of certain FLAGS in splice( ) giving an error when used with UDP .. those FLAGS seem to be working fine with TCP ..
 
Old 07-17-2009, 07:48 AM   #2
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 228

Rep: Reputation: 54
Quote:
I am not observing any throughput gains when using splice( ) over read( )/sendto( ).
splice() is intended to be used when the overhead of copying data between buffers decreases throughput.
In your application, this is not the case; probably because there is no pressure on the CPU, the caches and the memory bus. I'd guess that the network connection is the bottleneck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Splice syscall does not work vadiml Programming 7 10-15-2015 07:43 AM
splice ( ) not giving expected performance gains aditya.pipersenia Linux - Kernel 2 07-14-2009 09:06 AM
LXer: Linux Gains Flash, Ubuntu Gains Wikipedia - but Can They Change the World? LXer Syndicated Linux News 0 10-20-2008 11:20 AM
modem giving best performance with FC5 mystic_durle12 Linux - Hardware 8 06-12-2007 09:21 AM
SMP performance gains? bughead1 Slackware 3 06-02-2007 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 04:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration