Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Going from tens of tcp socket connections to 500 maybe more

Going from tens of tcp socket connections to 500 maybe more

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.2k Views
  • 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 Offline
    D Offline
    DBoosalis
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      TioRoy
      wrote on last edited by
      #2

      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
      0
      • D Offline
        D Offline
        DBoosalis
        wrote on last edited by
        #3

        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
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved