OMS (Order Management System) is the electricity supplier ERP system, the core module, wherein the order fulfillment process (shoe single process) is the last period of the consumer shopping process have a direct perception related to the user experience, and its correctness and timeliness It must be guaranteed. At the same time the process is the electricity supplier to fulfill a single system directly to the amount of data one subsystem peak sales surge caused by a short time, how the surge in traffic 10 times to ensure even OMS normal service more cases, each appliance business is the focus of close attention and continuous improvement.
And the front end of the process different orders, shoe single process without providing second-level real-time response, but it is work to be performed not only generate orders to save storage, and to coordinate the ERP in many subsystems, to external systems and manual processes together to accomplish an order the outbound shipments, so has the distinction problems and needs solutions.
In wheat bags, we experienced an hour orders peak from 1000 to 10,000 and then to 100,000 of the high-speed growth, although OMS in the middle of the table, paging, batch processing shock design, but year after year under the impact of high traffic peaks, is still blocked even when signs of collapse appear scary. To solve this problem, the need for the entire order process to fulfill all aspects of analysis to identify bottlenecks and surge threats, develop targeted solutions for evaluation and testing, a clear system of peak processing capacity to ensure that in all cases the correct handling.
Shoe single process flow control similar to flood management with truth, to find out the location of the high water level or burst reinforcement. Consolidation methods can be divided into two directions:
Dredge and widen the river - optimization algorithm, a reasonable parallel;
Storage limit - asynchronous buffer, Limited.
This will combine wheat bags shoe single process flow surge when faced with a problem, we need to study the process of nodal analysis, optimize efficiency, the inlet isolation and asynchronous technology, fixed flow control and flexible framework and other aspects will be discussed.
Focus: consistency, availability and peak capacity.
Minimum target: traffic is not higher than 100,000 per hour single case, it is possible to ensure that each submitted without manual confirmation http://www.chinadivision.com/ picking within 30 minutes; flow rate of not more than 1 million per hour under a single case, to ensure that each order slowest in Submit picking within 6 hours.
Superior goal: to dynamically enhance the flow is higher than throughput per hour 100 000 single, keeping the flow rate of not more than 150,000 each under orders to submit a single picking within 30 minutes.
Before discussing the governance program, we need to abstraction and decomposition processes, in-depth analysis.
Node Process Analysis
To ensure that the system in the case of normal service traffic surge, the whole process has not produced any point blocked. The so-called choke points are caused directly or indirectly a shared computing resource overload point. Electricity supplier in OMS, CPU and memory intensive computing is generally small, the overload computing resources mostly DB Server. In the end is what type of computing resources is not the most important, we need to find the cause or reason may lead to overload, to find their position in the program to solve.
Shoe single process from the business logic is generally divided into a plurality of steps back to back, we will call processing nodes, we have to do is to analyze the flow of each processing node, especially in the past produced a blocked node. In addition to the general code analysis, static analysis and unit testing data structure to produce excessive blocking node may also start from the field to analyze the log. For example, in the case of DB Server overload, blocking the scene to analyze SQL queue, find DB Server resource overload caused several major SQL, and then follow it to find these SQL trigger code location and processing nodes to which it belongs.
Wheat bags shoe single main flow of orders including audit, payment confirmation and warehouse generation, courier matching node, streamlined processes shown in Figure 1.
1 shoe single logic flow diagram
Through the code and perform log analysis, we found that manually review orders, logistics match takes longer automatically review the lack of order flow control and other issues. Node process takes too long not only on the execution time of the whole process has a direct impact, more importantly, when a large influx of orders may slow the accumulation of excessive database queries, database concurrency causing excessive overload. Manual order review, although not automatically part of the process, but because of automated processes and accessing the same database, in the face of a large number of orders will also slow down database performance, causing a lot of locks.
Submit picking shipments to submit this period belong to the scope of WMS also we need to continue to optimize, but this is beyond the topic of this article not be discussed here.
These issues need to be resolved, first of all we need to optimize the performance of a single node.
Basic processing capacity optimization (optimization of single-node)
A process consists of processing nodes, each node itself if there is room for optimization, so it is difficult to grasp the overall analysis of the optimal direction. Therefore, before the process level optimization for each node should first be optimized to ensure sufficient efficient calculation process itself, as well as the rational use of resources and for each node in the architecture scalability.
Overall tuning process before, we must first eliminate the bottleneck of the efficiency of each node, making optimization algorithm to improve the parallel efficiency, reduce or equitable distribution of computing resources occupied.
To optimize for the SOM (Sales Order Management) module for example, before optimization SOM module average request response time of 1.89 seconds, and optimized down to 0.09 seconds. Optimized single server can respond to requests 667 times per minute, while only about 32 times before optimization in system architecture and hardware resources the same premise, improves the processing capacity of the node, reducing the resources used.
Do optimization of a single node, focused primarily on logic optimization, optimization algorithms and code optimization. This topic has been discussed a lot, the basic principles are as follows.
Optimization algorithm, select the appropriate and efficient algorithms to reduce unnecessary recursive loop, multi-loop nest computing. With a simple algorithm to complete the majority of cases, not for the few exceptions and the algorithm complicated. Exception is handled by a special branch.
Avoid applying too much unnecessary memory overhead.
Timely release of resources, reduce resource consumption time, including memory, I / O, network and database.
Make good use of cache: cache common and difficult to change; occasional change, consider cache dependency mechanism.
Caution database lock.
Proper use of transaction, the transaction to be fine-grained.
Select the appropriate means of communication: Socket, Remoting, Web Services (REST and SOAP), WCF, Named Pipes, etc., should pay special attention to long connection and proper use of short connection.
Reduce the number of communications between systems or modules, such as workflow services and database services.
Reduce the amount of data transfer between systems or modules, unnecessary transmission does not pass or less pass.
Asynchronous computation to reduce waiting time.
Consider lazy loading and early loading in two ways.
The principle of separation: separation of service module, such as the separation of large I / O modules, memory modules, and the separation of high consumption and high consumption of broadband separation module.
Co-ordinate the use of computing resources, such as memory computing to seek the best balance database computing and network overhead between the three.
Optimization in a single node, the above methods may be used. For shoe single process, the parallel computing nodes and Scalability will also play a more important role.