In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis of improving the interactive load balancing ability of ServerSuperIO grouping. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
20.1 Overview
ServerSuperIO originally has only one network controller in the network communication mode, and it processes the returned data asynchronously in automatic control mode, concurrent mode and singleton mode, and there will be no performance problems. However, in the polling mode, a network controller has to operate the sending and receiving of device drivers one by one in order, so the polling period is too long to reach the data reading frequency.
In order to solve the above problems, the grouping function of the network controller is added to the parameters of the device driver, and the network controller will control the device driver according to the grouping name set by the device parameters. For example, in polling mode, there are 1000 device drivers, and the same packet name can be set for every 10 device drivers. These 10 device drivers are controlled by the same network controller. If the data is read every 1 second, then the polling period for each device driver is 10 seconds, and other network controllers are similar.
20.2 schematic diagram of network controller
According to the ControllerGroup that sets the device driver network parameters, the device driver can be assigned to different network controls to run, and it is suitable for polling, automatic control, concurrency and singleton control modes.
20.3 schematic diagram of serial port controller
By the way, the serial port controller is assigned to different serial port controllers by setting the serial number of the device driver, which can only be applied to the polling control mode.
20.4 device driver Network Controller grouping sample Code static void Main (string [] args) {string deviceID = "2"; DeviceDriver dev3 = new DeviceDriver (); dev3.DeviceParameter.DeviceName = "device 2"; dev3.DeviceParameter.DeviceAddr = 0; dev3.DeviceParameter.DeviceID = deviceID; dev3.DeviceParameter.DeviceCode = deviceID Dev3.DeviceDynamic.DeviceID = deviceID; dev3.DeviceParameter.NET.RemoteIP = "127.0.0.1"; dev3.DeviceParameter.NET.RemotePort = 9600; dev3.DeviceParameter.NET.ControllerGroup = "G2"; dev3.CommunicateType = CommunicateType.NET; dev3.DeviceParameter.NET.WorkMode = WorkMode.TcpServer; dev3.Initialize (deviceID); deviceID = "3" DeviceDriver dev4 = new DeviceDriver (); dev4.DeviceParameter.DeviceName = "device 3"; dev4.DeviceParameter.DeviceAddr = 0; dev4.DeviceParameter.DeviceID = deviceID; dev4.DeviceParameter.DeviceCode = deviceID; dev4.DeviceDynamic.DeviceID = deviceID; dev4.DeviceParameter.NET.RemoteIP = "127.0.0.1"; dev4.DeviceParameter.NET.RemotePort = 9600 Dev4.DeviceParameter.NET.ControllerGroup = "G3"; dev4.CommunicateType = CommunicateType.NET; dev4.Initialize (deviceID) IServer server = new ServerManager () .CreateServer (new ServerConfig () {ServerName = "Service 1", ComReadTimeout = 1000, ComWriteTimeout = 1000, NetReceiveTimeout = 1000, NetSendTimeout = 1000, ControlMode = ControlMode.Loop, SocketMode = SocketMode.Tcp, StartReceiveDataFliter = false ClearSocketSession = true, StartCheckPackageLength = false, CheckSameSocketSession = false,}) Server.AddDeviceCompleted + = server_AddDeviceCompleted; server.DeleteDeviceCompleted + = server_DeleteDeviceCompleted; server.SocketConnected+=server_SocketConnected; server.SocketClosed+=server_SocketClosed; server.Start (); server.AddDevice (dev3); server.AddDevice (dev4); while ("exit" = = Console.ReadLine ()) {server.Stop () }} this is the end of the article on "example Analysis of ServerSuperIO grouping to improve Interactive load balancing". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.