This application is based upon and claims the benefit of the prior Japanese Patent Application No. 2019-125175 filed on Jul. 4, 2019, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a switching apparatus and a switching method.
In the related art, there is a system in which data is collected and a specific process is performed based on the collected data. As such a system, for example, a so-called distributed file system is used in which different processes are shared by a plurality of servers.
For example, there is a technique of providing a resource of a distributed file system in order to execute a task as a specific process. In this technique, tasks, schedulers, and pools are re-allocated based on the need for load balancing of the distributed file system.
There is also a technique of reducing the overhead required for a time synchronization process and increasing the efficiency of a data collection process by a data collection device. In this technique, for a relay terminal that performs a message transfer process, the time required for the transfer process (transfer delay time) is measured as a measurement delay time, and is added to the time information of a transfer message.
In addition, there is a technique of preventing the read performance of an external application from being lowered. In this technique, data is re-located in order to level the load in the distributed file system. In the re-location, the maximum re-location amount is set as the data amount to be re-located in one data re-location execution process. Further, the data server closest to a re-location destination data server is used as a data server of a block copy source
Related technologies are disclosed in, for example, Japanese National Publication of International Patent Application No. 2015-503811 and Japanese Laid-Open Patent Publication Nos. 2011-091624 and 2015-022327.
According to an aspect of the embodiments, a non-transitory computer-readable recording medium having stored therein a switching program that causes a computer to execute a process, the process includes when a first server that executes a reception function of receiving data from a device receives a calculation request for switching a function from the reception function to a task processing function of processing data, calculating a data movement amount of data to be moved, among data held by the first server, based on a data amount of unprocessed data that has not been read from a second server which executes the task processing function, a first transfer speed determined from a transfer speed of a bandwidth of the first server and a transfer speed of a bandwidth of a third server which is a movement destination of data held by the first server, and a second transfer speed which is a transfer speed of reading data from the second server, specifying a movement start position of data that moves from the first server to the third server in the data held by the first server, based on the calculated data movement amount, and starting data movement, from the movement start position, from the first server to the third server.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
In the distributed file system, the role of each server is divided into, for example, a function of receiving and collecting data and a function of acquiring data and executing a task that is a specific process. As for the type of a server, a server that receives data is defined as a data reception server, and a server that executes a task is defined as a task processing server. In this case, the process of switching the function of the server is performed according to the load of the server that plays each of roles.
However, in the related art, when the data reception server is switched, there is a problem regarding data movement accompanying the switching.
In the related art, there is a problem that the switching of the data reception server causes a waiting time to occur in the task processing server that has acquired data from the data reception server.
Further, even when data is moved before notifying the task processing server of a switching instruction, there is a problem in the traffic of the data to be moved. This is because it is not possible to grasp the switching timing of the data reception server, and it is necessary to move all the data or the remaining data at the time of starting the movement. In this case, since the data read by the task processing server before switching is also copied to a data reception server of a movement destination, useless traffic is generated. In addition, when the movement destination is changed for a certain reason, such as when the data reception server of the movement destination stops, there is another problem that more useless traffic is generated.
Hereinafter, an example of an embodiment according to a technology of suppressing traffic caused by switching of server functions and shortening an interruption time of processing will be described in detail with reference to the drawings.
First, descriptions will be made on the background on which the embodiment is based and the outline of the present embodiment. The technique of the present embodiment is applied to a management system in which data is collected and a task is executed as a specific process based on the collected data. The management system is a so-called distributed file system. In a distributed file system, different servers share different roles. According to the role, the types of a server in the management system are divided into a data reception server as a server that receives data and a task processing server as a server that executes a task, and these servers perform functions of data reception and task processing, respectively.
The management system is used to execute various tasks such as collecting data of automobiles and analyzing operation information thereof, and collecting and analyzing moving states of people in a facility.
The management system is used in a so-called edge computing environment. An edge computing has a structure in which a server near each user's terminal is identified as an edge, and servers are distributed at each edge site to provide a service having a high real-time performance by a distributed process. In the edge computing, for each edge site, streaming data generated in an area in charge of the edge site is collected, and the collected data is processed.
Here, it is assumed that the data amount of data and the task amount of a task change. The data amount and the task amount change depending on, for example, the movement of data sources such as automobiles or events such as sudden accidents. Therefore, it is difficult to estimate the data amount and the task amount in advance. For this reason, it is necessary to switch the function of the server in the management system. The management system does not fix a ratio of the number of data reception servers and the number of task processing servers according to the data amount and the task amount, but switches roles to dynamically adjust the ratio of servers. As such, the function of the server is switched to distribute the load and perform a processing in more real time.
When the task processing server is switched to the data reception server, the task waiting for processing in the task processing server to be switched is re-located to another task processing server. When the data reception server is switched to the task processing server, the data held in the data reception server to be switched is moved to the data processing server of another movement destination. The destination of the data generated at any time also changes the routing of the DNS server such that the data is sent to the data processing server of the movement destination.
Here, descriptions will be made on a problem occurring when the data reception server is switched to the task processing server. When the data reception server of data is switched to the task processing server, it is necessary to move the data stored in the data reception server to another data reception server. However, during that time, the reading of data from the task processing server is interrupted.
In addition, when data is moved in advance before switching in order to eliminate the above-described waiting time, there is a problem that unnecessary traffic is generated.
Therefore, in the present embodiment, among unprocessed data that has not been read, a data amount ratio between the data read during the movement and the data read after the movement is completed, that is, the data to be moved is calculated.
A method of calculating the data amount ratio will be described. The data amount ratio is calculated according to the following equations (1) and (2) such that the read time of data read during movement and the transfer time of data to be moved may become equal.
Here, the symbol “Dc” refers to the data amount of data to be moved, the symbol “Dr” refers to the data amount of data read from a server i during movement, and the symbol “Da” refers to the data amount of unprocessed data that has not been read. The unit of the data amount is bit. It is assumed that the data reception server to be switched is i and the data reception server of the movement destination is j. The symbol “TPi,j” refers to a transfer speed of the bandwidth between the servers i and j, and RD
When the transfer speed TPi,j of the bandwidth is the same as the transfer speed RDr of reading, the data amount Dc and the data amount Rr are each ½ of the data amount Da with respect to the data amount Da.
A case where the read time is the same as the transfer time will be described. For example, it is assumed that the data amount Da of unprocessed data is 600 Mbps, the transfer speed TPi,j of the bandwidth is 6 Mbps, and the transfer speed RDr of reading is 6 Mbps. In this case, the data amount Dc and the data amount Dr may be calculated as 300 Mbit according to the above equation (2). Further, the read time and the transfer time in the above equation (1) may be respectively calculated as 50 seconds. That is, it is possible to specify that the data movement start position is a position of 300 bits from the data read last.
A case where the read time and the transfer time are not the same will be described. For example, it is assumed that the data amount Da of unprocessed data is 600 Mbps, the transfer speed TPi,j of the bandwidth is 6 Mbps, and the transfer speed RDr of reading is 2 Mbps. In this case, the data amount Dc and the data amount Dr may be calculated as 450 Mbit and 150 Mbit, respectively, according to the above equation (2). Further, the read time and the transfer time in the above equation (1) may be respectively calculated as 75 seconds. That is, it is possible to specify that the data movement start position is a position of 450 bits from the data that is read last. Meanwhile, the same calculation may be performed even when the relationship between the bandwidth and the transfer speed of reading is reversed.
A method of obtaining the data amount ratio has been described above. In the embodiment described below, the same calculation is performed for each topic that is the type of data. The details of the topic will be described later in the explanation of the operation.
In the present embodiment, the function switching of the server in the management system is implemented by using the method described above. Hereinafter, the configuration of the embodiment of the present disclosure will be described.
The management server 100 includes a communication unit 102, a data task controller 104, a load controller 106, a switching controller 108, a task processing DB 120, a load information DB 122, and a bandwidth information DB 124.
Since the plurality of data reception servers 200 have the same configuration in each server, the configuration of one data reception server 200 is taken as an example. The data reception server 200 includes a communication unit 202, a load response unit 204, a data processing unit 206, a switching processing unit 208, and a data DB 220.
Since the plurality of task processing servers 300 have the same configuration in each server, the configuration of one task processing server 300 is taken as an example. The task processing server 300 includes a communication unit 302, a load response unit 304, a task processing unit 306, a switching processing unit 308, and a task DB 320.
The DNS server 400 includes a communication unit 402, a routing registration unit 404, a response unit 406, and a routing table DB 420.
The proxy server 500 includes a communication unit 502, a determination unit 504, and a routing unit 506.
The management server 100 may be implemented by, for example, the computer 20 illustrated in
The storage unit 23 may be implemented by a hard disk drive (HDD), a solid state drive (SSD), a flash memory, or the like. The storage unit 23 serving as a storage medium stores a management program 30 that causes the computer 20 to function as the management server 100. The management program 30 includes a communication process 32, a data task control process 33, a load control process 34, and a switching control process 35.
The CPU 21 reads out the management program 30 from the storage unit 23, expands the program in the memory 22, and sequentially executes the processes of the management program 30. The CPU 21 operates as the communication unit 102 illustrated in
In the meantime, the functions implemented by the management program 30 may well be implemented by, for example, a semiconductor integrated circuit, more specifically, an application specific integrated circuit (ASIC), etc.
Since the data reception server 200 and the task processing server 300 have the same configuration, these servers may be implemented by, for example, the computer 40 illustrated in
The storage unit 43 may be implemented by an HDD, an SSD, a flash memory, or the like. The storage unit 43 as a storage medium stores a processing program 50 that causes the computer 40 to function as the task processing server 300 or the data reception server 200. The processing program 50 has a communication process 52, a load response process 53, a main processing process 54, and a switching processing process 55.
The CPU 41 reads out the processing program 50 from the storage unit 43, expands the program in the memory 42, and sequentially executes the processes of the processing program 50.
The operation in the case of the data reception server 200 will be described. The CPU 41 operates as the communication unit 202 illustrated in
Meanwhile, the functions implemented by the processing program 50 may well be implemented by, for example, a semiconductor integrated circuit, more specifically, an ASIC or the like.
Since the DNS server 400 and the proxy server 500 may be implemented by a general DNS server and a server used as a proxy server, a description of the configuration of the computer will be omitted.
Next, the operation of the management system 10 according to the present embodiment will be described. First, the flow of processing that is a premise of the method of the present embodiment will be described with reference to the sequence diagram of
First, data and task processing will be described with reference to
The proxy server 500 receives information of data or task (S10). The determination unit 504 of the proxy server 500 determines whether the information is data or a task (S12).
The data includes a destination address, a source address, a topic, and a data entity. The topic represents a type of data and is a unit in which data read by a task is put together. The task reads the topic and executes the task. Further, data may be associated with a plurality of topics. Meanwhile, the destination address is the address of the proxy server 500, and the source address is the address of the device that has transmitted the data.
The task includes a destination address, a source address, a task ID, and a topic required for processing the task. Tasks are executed by reading data in units of topics. Meanwhile, the destination address is the address of the proxy server 500, and the source address is the address of the device that has transmitted the task.
When the information determined in S12 is data, the proxy server 500 registers or refers to the DNS server 400 by the routing unit 506 (S14). When the routing destination of the data topic is in the routing table DB 420, the address is acquired as the destination. When the routing destination of the data topic is not in the routing table DB 420, the routing registration unit 404 registers a routing in the routing table DB 420. For the address of the data reception server 200 to be registered, for example, the address of the data reception server 200 whose resource memory usage rate is low may be registered with reference to the load information DB 122 of the management server 100.
As illustrated in
The proxy server 500 refers to the address of the routing table DB 420 by the routing unit 506 (S14), and transmits data to the data reception server 200 of the address obtained by referring to the address (S16). The data processing unit 206 stores the data received by the data reception server 200 in the data DB 220 (S18).
As illustrated in
When a determination made in S12 is a task, the proxy server 500 transmits the task to the management server 100 using the routing unit 506 (S20). The task transmitted in S20 is received by the management server 100, and the data task controller 104 determines the task processing server 300 that executes the task to update the task processing DB 120 (S22). The task processing server that executes the task may refer to the load information DB 122 and select the task processing server 300 having a low memory usage rate. Meanwhile, the data task controller 104 may schedule and determine the task execution timing.
As illustrated in
The data task controller 104 transmits the received task to the task processing server 300 at the corresponding address in the task processing DB 120 (S24). The task received by the task processing server 300 is stored in the task DB 320 (S26).
As illustrated in
The task processing server 300 executes the tasks in the order stored in the task DB 320 (S28). When executing the task, the task processing unit 306 refers to the data routing to the DNS server 400 (S28-1) and receives the address of the data reception server 200 from which the data is read. The task processing unit 306 reads data included in a topic necessary for processing the task from the received address of the data reception server 200 (S28-2), and executes the task.
Further, in the management system 10, load information and bandwidth information are collected as a periodic processing. The task processing server 300 and the data reception server 200 transmit the load information to the management server 100 (S30, S32). The load information is stored in the load information DB 122 (S34). Further, the management server 100 collects the bandwidth information (S36, S38) and stores the information in the bandwidth information DB 124 (S40).
As illustrated in
As illustrated in
The load response unit 304 of the task processing server 300 and the load response unit 204 of the data reception server 200 periodically transmit load information of their own servers to the management server 100.
Next, with reference to the sequence diagram of
In the meantime, since the calculation of the data movement amount and the movement time is performed in units of topics, the relationship among data, topics, and tasks is organized.
In the sequence diagram of
In each of the data reception servers 200, the switching processing unit 208 calculates, for each topic of the data DB 220, the data movement amount according to the above equation (2) and the movement time according to the above equation (1) (S54). The calculation is performed based on the data amount Da of unprocessed data, the transfer speed RDr of reading, and the transfer speed TPi,j of the bandwidth. As for the transfer speed TPi,j of the bandwidth, the transfer speed of the bandwidth between the data reception server 200 and the other data reception server 200 in the bandwidth information DB 124 of the management server 100 may be referred to and the transfer speed of the lower bandwidth may be adopted. Here, a server having the highest bandwidth transfer speed may be selected as the other data reception server 200. When the data reception server 200 that has performed the calculation becomes a switching target, the data reception server 200 selected here becomes the data reception server 200B of the movement destination. As for the transfer speed RDr of reading, the transfer speed of the bandwidth between the data reception server 200 and the task processing server 300 that is reading data in the bandwidth information DB 124 of the management server 100 may be referred to and the transfer speed of the lower bandwidth may be adopted. It is assumed that the longest movement time among the movement times calculated for each topic is the movement time required to switch the data reception server 200. The calculation result is assumed to be the topic having the longest movement time, the data movement amount of the topic, and the movement time of the topic. Meanwhile, the transfer speed of the bandwidth used for the calculation may be included in the calculation request.
Each of the data reception servers 200 transmits the calculation result to the management server 100 (S56). The management server 100 causes the switching controller 108 to determine the data reception server 200 having the shortest movement time among the calculation results of the data reception servers 200 as the data reception server 200A to be switched (S58), and transmits a switching request thereto (S60-1). In addition, a request for routing destination change is transmitted to the DNS server 400 (S60-2). The change request includes the topic of the calculation result, the address of the data reception server 200A, and the address of the data reception server 200B of the movement destination.
When the data reception server 200A receives the switching request by the switching processing unit 208A, the switching processing unit 208A specifies the movement start position from the data movement amount for the data included in the topic having the longest moving time (S62). Here, the movement start position specified from the data movement amount will be described. For example, it is assumed that the unprocessed data amount of a topic is 600 Mbit and the data movement amount thereof is 300 Mbit. It is assumed that the breakdown of the unprocessed data amount includes 10 pieces of data of 60 MB each read in the order of A, B, C, D, E, F, G, H, I, and J as unprocessed topic data. In this case, since the data movement amount of 300 Mbit is half of the unprocessed data amount of 600 Mbit, the sixth data F after the fifth may be determined as the movement start position. Meanwhile, the determination method is merely an example, and any determination method may be used when the movement start position may be determined based on the data movement amount.
The switching processing unit 208A of the data reception server 200A starts moving data from the specified movement start position to the data reception server 200B (S64). The data reception server 200A determines whether movement of all data from the topic movement start position has been completed in the switching processing unit 208A (S66). When it is determined that the movement has been completed, the process proceeds to S70-1. When it is determined that the movement has not been completed, the determination is repeated, and the completion of the movement is waited for.
Upon receiving a request for the routing destination change, the DNS server 400 changes the routing destination of the topic of the calculation result (S68). Specifically, the address of the topic is changed from the address of the data reception server 200A to the address of the data reception server 200B. By changing the routing in this way, the destination of the data of the topic received by the proxy server 500 from the device becomes the data reception server 200B.
When the data movement has been completed, the data reception server 200A causes the switching processing unit 208A to transmit a read destination switching request to the task processing server 300A (S70-1). In addition, the movement completion notice is transmitted to the management server 100 (S70-2). Meanwhile, the read destination switching request may include the data movement start position. By including the movement start position, the task processing server 300A may check whether the data before the movement start position may be read. When it is not possible to read the data to the movement start position, the data that may not be read is read from the data reception server 200A, and from the movement start position, data is read from the data reception server 200B. This makes it possible to prevent inconsistency due to data loss.
When the task processing server 300A receives the read destination switching request, the switching processing unit 308A interrupts reading (S72-1) and inquires the DNS server 400 about the routing (S72-2). The switching processing unit 308A changes the data read destination from the inquiry result and restarts the data reading (S74). The switching processing unit 308A transmits a read restart notice to the management server 100 (S76).
Upon receiving the movement completion notice from the data reception server 200A and the read restart notice from the task processing server 300A, the management server 100 notifies the data reception server 200A of a task allocation start request (S78). Upon receiving the task allocation start request, the data reception server 200A switches the function of the server to the task processing (S80).
As described above, the management system according to the present embodiment calculates the data movement amount and the movement time based on the transfer rate and the unprocessed data amount. The data movement start position is specified from the data movement amount. For this reason, it is possible to suppress the traffic accompanying the switching of the function of the server and shorten the interruption time of the processing.
Further, for example, in the above-described embodiment, descriptions have been made on the case where the data reception server 200 calculates the data movement amount and the movement time as an example, but the present disclosure is not limited thereto. For example, necessary information may be transmitted from the data reception server 200 to the management server 100, and the management server 100 may calculate the data movement amount and the movement time.
Also, various programs may be read from a storage medium.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to an illustrating of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2019-125175 | Jul 2019 | JP | national |