S9t9 for real time data acquisition projects

Source: Internet
Author: User
Tags cpu usage

Source: S9t9 For real-time data acquisition projects

S9T9 for real-time data acquisition projects, scenarios such as this: 5000 clients, each client every 500MS to upload data to the server.

As you know, the S9T9 forum, like Indy This blocking communication control, can generally support a TCP long connection that cannot be more than 1000 (if you want to maintain a stable operation).

The reason is that everyone knows that the blocking method will create a new thread for each socket connection, and that the maximum number of threads a single process in Windows can theoretically allow is 2048.

Actually, it's a lot less to do.

Some say it can be solved with the IOCP communication model of windows, admittedly. But IOCP programming is too complex.

It is said that you can use Indy to solve the problem by using a short connection. In view of the frequency of uploading data every 500MS, short connections are not really suitable, because a short connection will have to establish and disconnect the socket every time.

It is particularly time-consuming to establish and disconnect socket connections, so you use a TCP long connection.

Some people say why think of blocking, the answer is: because blocking programming is the simplest.

In fact, for the 5000-long connection of the client, Indy can have a way to achieve. Since a single process can only support 1000 or so long connections, is it possible to support 5,000 long connections by opening 5 processes?

It is said that the blocking of the 5,000 connections means that Windows will open 5,000 threads, so many threads, windows can suffer.

So immediately hands-on experiment, a process opened 1500 threads, a total of 4 processes, each thread every 100ms, execution for the i:=1 to Do,windows Task Manager display, each process

Occupy 40.4M of memory, CPU utilization rate only percent a fraction, total CPU usage only a few percent, memory usage rate also only 20%,windows dispatch not a little problem.

This scenario requires only one public network IP, which binds different ports for different processes.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.