Scsi command optimization method based on the FC-SAN memory device
Technical field
Belonging to FC-SAN based on the scsi command optimization method of FC-SAN memory device is optical-fibre channel---the storage area network technical field.
Background technology
Because the high transfer rate of optical-fibre channel, support multiple transport protocols, based on characteristics such as the low expense of block I/O access, remote accesses, become the main flow of network store system based on storage area network (SAN) storage system of optical-fibre channel.Characteristics such as particularly multi-user's parallel access, equipment are shared, data sharing, optical-fibre channel SAN (FC-SAN) storage system need realize features such as enhanced scalability, high-performance, and guarantees multi-user's access performance demands such as I/O request response time.
Under multi-user's parallel environment, the user can share FC-SAN memory device arbitrarily, and wherein each kind of data.Not only exist because the problem that the increase of client causes operating load stream to increase, and may exist a plurality of users in a period of time, to concentrate same disk of access or same blocks of data etc. and the disk hot spot phenomenon that occurs.
Therefore the I/O access performance that how to guarantee the FC-SAN storage system is the major issue under multi-user's parallel environment.According to our The performance test results, the performance bottle of present FC-SAN storage system footpath mainly is present in the SAN memory device.But yet there are no the fine granularity optimization method that flows feature under the concurrent user environment according to scsi command based on the FC-SAN memory device, the method that we propose has taken into full account the scsi command stream feature under the parallel environment, has improved the I/O performance of system effectively.
Summary of the invention
The object of the present invention is to provide a kind of small computer system interface that is conceived to solve memory device one side is the scsi command optimization method based on the FC-SAN memory device that scsi command is handled complicated inefficiency problem.
The invention is characterized in:
It is by being stored in optical-fibre channel---storage area equipment is that the small computer system interface in the memory node controller among the FC-SAN is that the scsi target simulator is carried out at the special I processor.It contains successively and has the following steps:
(1) set:
The data structure of queue command, it contains successively:
Operational order int Top
Operating equipment int Tlun
Operation address int Taddr
Stand-by period int Ttime
Executing state int Tcmdstatus
Follow-up command pointer struct TSCThread Node*next
Wherein, TCT is a TSC transmitter start code,
Node is a data structure
Interface function:
The optimal conditions discriminant function,
Iterated command judgement and processing function,
Overtime judgement and processing function,
Neighbour's command determination and processing function,
(2) carry out as follows successively
(2.1) judge whether and can optimize with containing queue command Parameter Optimization condition judgment function,, carry out according to the following steps successively if can optimize,
(2.2) judge whether to exist the scsi command of the repetition that a plurality of users that sent by different user or same send with the iterated command discriminant function, if exist, then processing threads is only dispatched this scsi command with corresponding pooled function processing once, and the order of other repetition is deleted; Otherwise, change next step over to.
(2.3) judge whether the situation whether stand-by period in the queue command parameter requires greater than the processing time with overtime discriminant function, if exist, then processing threads postpones the back that these orders are put into this scsi command to handle with the timeout treatment function according to its start address and skew, otherwise, change next step over to.
(2.4) judge with closing on the command determination function whether the scsi command in each scsi command formation exists correlation on the access address, promptly visiting same device address closes on, if exist, processing threads is merged into a scsi command that uses continuation address with handling the scsi command of function with a plurality of address correlations accordingly, and other order deletion.
If with the throughput data before optimizing is that standard compares, still be medium-term and long-term weather forecast treatment system no matter for the video system of coaching, the throughput after its optimization all has phenomenal growth.
Description of drawings
The topological diagram of Fig. 1 optical fiber storage networking
The location drawing of Fig. 2 memory node controller THMSNSc102 in memory device
The complete I/O path of Fig. 3 SAN storage system
Fig. 4 scsi target simulator structural representation
The program flow diagram of Fig. 5 optimization method of the present invention
Queue structure's schematic diagram of Fig. 6 scsi command
Embodiment
Fig. 1 ~ Fig. 4 is the special I/position of O processor THMSNSc102 in the FC-SAN storage area network.
This method is implemented in special I/O processor THMSNSc102 promptly on the memory node controller.Its hardware environment and operating system are as follows:
CPU | 2xXeon2GHz |
Internal memory | 1GB |
The fiber optic network interface card | Qlogic?qla2310F |
The SCSI-RAID card | Adapter3410s |
Operating system | Linux?2.4.18-3smp |
The RAID disk array | 14xSeagatex73G(10Krpm)SCSI?Disks |
The queue structure of scsi command as shown in Figure 6
This method is used following operation and function (parameter is illustrated with definition in Fig. 6 structure):
The optimal conditions discriminant function:
int?scsi_target_cmd_switch(TSCThreadQueue*ttg,TSCThreadLength?tl),
The iterated command discriminant function:
Tcompare(ttg->Top,ttg->Tlun,ttg->Taddr,i),
The iterated command pooled function
scsi_target_cmd_combin(ttg,i)
Overtime judgement
Ttg->Ttime>Tmaxtime Tmaxtime is the maximum processing time of program setting
The timeout treatment function
scsi_target_cmd_timelg(ttg,i)
Neighbour's command determination function
Tnearby(ttg->Top,ttg->Tlun)
Neighbour's command processing function:
scsi_target_cmd_nearby(ttg,i)
The scsi target simulator is a concentrated I/O request control and handles the position, by each scsi command in the scsi command formation, can clearly discern details such as the position of data block of all clients that send scsi commands, access and block size.It goes to carry out method of the present invention by program circuit shown in Figure 5.
Major advantage based on the scsi command optimization method of FC-SAN memory device is as follows:
1, consider the characteristics of a plurality of user side access adjacent data blocks, this method is carried out the access address and is merged processing, and a plurality of scsi commands are merged into a scsi command, has reduced the physical treatment times such as disk tracking effectively, has improved the I/O handling property.
2, this method has been considered the I/O access performance and the fair principle of scsi command, and all scsi commands can effectively be handled.
3, this method has taken into full account the characteristics of FC-SAN memory device buffer memory CACHE, effectively utilizes CACHE mechanism on the one hand, has solved the read-write problem of big data block on the one hand again effectively.
4, this method can be discerned in the same command queue scsi command from the same characteristic features of different clients, and carries out disposable processing, has reduced by N-1 operation.
5, this method has been considered the feature of disk access, has reduced physical operations number of times such as disk tracking as much as possible.Also adopt related method thereof to solve HOT SPOT problem simultaneously, improved the I/O access performance effectively.
Under identical test environment, employing is based on the special I processor THMSNSc102 of the scsi command optimization method of FC-SAN memory device, can improve the performance of the FC-SAN storage system about 10-20% effectively, and and client user's number and operating load have bigger relation: 1) if under the environment of large-scale storage system, this method can more effectively improve the I/O access performance of system; 2) if there is bigger correlation in the operating load of user side, then systematic function is improved more obvious.Another outstanding feature of this method is irrelevant with architecture and specific implementation, can be applied in the different scsi target simulator architectures.
The present invention (special I processor THMSNSc102) has passed through test on No. hundred billion parallel computers of being researched and developed voluntarily by Tsing-Hua University, and carrying out application such as video on-demand system, medium-term and long-term data of weather forecast treatment system on this basis, performance all is significantly improved behind the employing said method.
With the throughput data before optimizing is that standard value 100% compares
| Throughput before optimizing | Optimize the back throughput |
Video on-demand system | 100% | 125% |
Medium-term and long-term data of weather forecast treatment system | 100% | 115% |