Python / Socket speed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • msj@infoserv.dk

    #1

    Python / Socket speed

    Seems like sockets are about 6 times faster on OpenSUSE than on
    Windows XP in Python.

    Just written a small script to test network/firewall performance in Python, and could not help myself from testing it on both XP and Linux.....


    Is this related to Python or the OS?

    /MSkou

  • Richard Brodie

    #2
    Re: Python / Socket speed


    <msj@infoserv.d kwrote in message
    news:1172501644 .228475.57540@a 75g2000cwd.goog legroups.com...
    Seems like sockets are about 6 times faster on OpenSUSE than on
    Windows XP in Python.
    >
    Just written a small script to test network/firewall performance in Python, and could not help myself from testing it on both XP and Linux.....

    >
    Is this related to Python or the OS?
    It's 6 times faster even when not using Python, so what do you think?
    It's probably 'just' tuning though, the default window sizes are in the
    same ratio.


    Comment

    • Paul Boddie

      #3
      Re: Python / Socket speed

      On 26 Feb, 15:54, "m...@infoserv. dk" <m...@infoserv. dkwrote:
      Seems like sockets are about 6 times faster on OpenSUSE than on
      Windows XP in Python.
      >
      Just written a small script to test network/firewall performance in Python, and could not help myself from testing it on both XP and Linux.....

      >
      Is this related to Python or the OS?
      >From the output:
      TCP window size: 8.00 KByte (default)
      TCP window size: 49.4 KByte (default)
      I don't pretend to be an expert on TCP/IP, but might the window size
      have something to do with it?

      Paul

      Comment

      • casevh@gmail.com

        #4
        Re: Python / Socket speed

        On Feb 26, 7:05 am, "Paul Boddie" <p...@boddie.or g.ukwrote:
        On 26 Feb, 15:54, "m...@infoserv. dk" <m...@infoserv. dkwrote:
        >
        Seems like sockets are about 6 times faster on OpenSUSE than on
        Windows XP in Python.
        >>
        Is this related to Python or the OS?
        From the output:
        TCP window size: 8.00 KByte (default)
        TCP window size: 49.4 KByte (default)
        >
        I don't pretend to be an expert on TCP/IP, but might the window size
        have something to do with it?
        >
        Paul
        Tuning the TCP window size will make a big difference with Windows XP
        performance. I'm more curious about the original script. Either the
        test was against the loopback address, or he has a very impressive
        netork to sustain 1.8Gbit/s.

        casevh

        Comment

        • John Nagle

          #5
          Re: Python / Socket speed

          Richard Brodie wrote:
          <msj@infoserv.d kwrote in message
          news:1172501644 .228475.57540@a 75g2000cwd.goog legroups.com...
          >
          >>Seems like sockets are about 6 times faster on OpenSUSE than on
          >>Windows XP in Python.
          >>
          >>http://pyfanatic.blogspot.com/2007/0...rformance.html
          >>
          >>Is this related to Python or the OS?
          >
          >
          It's 6 times faster even when not using Python, so what do you think?
          It's probably 'just' tuning though, the default window sizes are in the
          same ratio.
          Sockets and pipes are a terrible way to do local interprocess
          communication, but it's what we've got. The problem is that what you
          want is a subroutine call, but what the OS gives you is an I/O operation.
          If you want to see it done right, take a look at QNX messaging. QNX
          does everything, including I/O and networking, via its interprocess
          communication message passing system. There's the cost of one extra
          copy for every I/O operation, but you don't notice it much in practice.
          I've run 640x480x15FPSx2 4bits video through QNX messaging and only used
          2% of an 1.5GHZ x86 CPU doing it.

          John Nagle

          Comment

          • Paul Rubin

            #6
            Re: Python / Socket speed

            John Nagle <nagle@animats. comwrites:
            Sockets and pipes are a terrible way to do local interprocess
            communication, but it's what we've got. The problem is that what you
            want is a subroutine call, but what the OS gives you is an I/O operation.
            Using TCP sockets is ridiculous but Unix domain sockets aren't that
            bad. There's also mmap or shm.

            Comment

            Working...