Find the answer to your Linux question:
Results 1 to 2 of 2
Hii I am doing some experimentation work on the splice ( ) system call. My hardware does not support Scatter-Gather DMA . I have 2 server applications for transmiiting data ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    1

    Question splice( ) not giving performance gains over sendto( )


    Hii

    I am doing some experimentation work on the splice ( ) system call. My hardware does not support Scatter-Gather DMA. 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 read( )/sendto( ) system calls i.e.

    read( ) -> to read contents of the file and
    sendto( )-> to send the read contents to the connected socket (client side).

    2). The other application uses the 'splice mechanism' for sending the data. i.e.

    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)

    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 splice( ) over read( )/sendto( ).

    I am wondering if splice( ) 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

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,525
    Chances are you have saturated your network bandwidth or the ability of the server to handle the data flow. Are you monitoring your network bandwidth usage, system port speeds, cpu utilization, interrupt volume, etc?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •