Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Going from tens of tcp socket connections to 500 maybe more

    General and Desktop
    3
    4
    1987
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DBoosalis last edited by

      Seeking advise for supporting large amounts of sockets with QT.

      I have a very nice server app that uses QtCore, QNetwork and QSql, its been rock solid with say 10 to 20 simultanious tcp connections but I want to scale it up to handle ten to hundred times more. Currently each socket is writtent to using a giant for loop that iterates though the whole list of sockets. Now I heard writting to a socket is fast, but was wondering what kind of delay will be from writing a buffer to socket number one to socket number 1000 in the list. I have no way of testing this out across 1000 real simultanious connections so wanted to seek advise here.

      Any advise, should I move away from Qt and go down to Linux sockets (these are tcp).

      Thank you very much for any feedback

      -David

      1 Reply Last reply Reply Quote 0
      • T
        TioRoy last edited by

        I did remember the "c10k problem":http://www.kegel.com/c10k.html :)

        Do you want to send the same packet to all sockets (broadcast)? I guess removing Qt will not solve your problem.

        Maybe "QtConcurrent":http://qt-project.org/doc/qt-4.8/threads-qtconcurrent.html can help you.

        1 Reply Last reply Reply Quote 0
        • D
          DBoosalis last edited by

          Thanks for the url, the infomration is a bit dated but still worth reading. I am sending the same data to every socket by the way

          1 Reply Last reply Reply Quote 0
          • K
            koahnig last edited by

            I have done a test with such a setup. IIRC I did a stress test with up to 500 sockets to be served. The CPU gets a bit busy. But it seemed to have nothing special up to this range.
            The server sends real-time data of less than one 1k per socket with an update rate of 1 Hz.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post