No announcement yet.

STRING CONCATENATION - What really is the fastest most efficient way?

  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    There are discussions on creating a million, but not getting into that.

    Number of connections: instead of google


    • #22
      Fascinating. Thanks for the link Mike.


      • #23
        Originally posted by David Clarke View Post

        I have two arrays TCP_RECV(999) AND ACCUMULATED_TCP_RECV (999)
        Each communicating device (socket) has its own receive buffers (those two arrays) indexed by a thing I call CONTROLLER_UNIQUE_ID that is looked up by MAC Address in a database. That is how we keep everything separate. So far never lost any data in 4 years and hundreds of million communications.

        I am trying to figure out if there is a practical upper limit to the number of connections I can service on one computer. Something of an ongoing project. I could make it so I only call CONVERT_FILE_HANDLE_TO_FILE_NUMBER once in the first connection- then keep that info in an array....
        I'm curious about your application. Are you required to maintain a persistent connection to hundreds or thousands or remote devices? Is the data that you exchange long as in file transfers or short (say, under 1500 bytes) as in telemetry and NMS messages?

        If the messages are short and you DO need thousands of simultaneous connections, you may want to consider UDP vs TCP. In that way, you can support thousands of connections on a single socket and take care of "multiplexing" in your application at a higher level.

        This is how some IoT protocols handle large-scale deployments. The vast majority of the messages are short and do things like heartbeat polls, environmental and performance data collection and SCADA-type functions (e.g.turn stuff on and off). If larger data needs to periodically be transferred (e.g. log files), then the UDP-based protocol can initiate a transfer that uses TCP-based protocols, such as FTP.


        • #24
          Hi Jerry,

          My devices are a mix of things. Some access control controllers, some PCLs, some stuff we make. We don't and do need to maintain connections and the ones where we want to maintain will "call home" if they disconnect. The traffic is light to busy depending on the time of day. We are offering this as a service over the Internet to some trial customers. Yes it is all encrypted. Actually they all call home but some need to report ASAP. So while staying connected is not that important for 10 seconds after that we like to know the device is there. We have a heartbeat between us and the devices every 10 seconds. Just a couple of bytes to know they are there and on the job.

          My current goal is to see how many connections we can handle - that will help us understand how we will scale the thing. Plus I always like knowing how to best do something. We have to stay TCP IP as the devices we don't make need it and we need the error management.

          Does that help?


          • #25
            Thanks Mike! I have read that and I do have socket tools! The "tinkerer" in me likes to try to do some of this without external an library.