Method for processing high-concurrency IO based on PHP

An asynchronous processing and threading technology, applied in electrical digital data processing, program startup/switching, inter-program communication, etc., can solve problems such as wasting CPU resources, solve the problem of frightening herds, improve IO processing capabilities, and solve performance bottlenecks. Effect
CN110795254APending Publication Date: 2020-02-14武汉智美互联科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
武汉智美互联科技有限公司
Publication Date
2020-02-14

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a method for processing high-concurrency IO based on PHP. The method comprises: Swoole creating one or more processes according to configuration; the Master process creating NReactor threads; creating a coroutine in each Reactor thread; and asynchronously processing the IO task through coroutine scheduling. According to the invention, a Swoole model is used, through the multi-thread Reactor model (based on epoll) and a multi-process Worker, a coroutine is created in each thread. Through coroutine scheduling, an IO task is asynchronously processed, namely, when meetingthe condition of IO time consumption, firstly processing other code logics through coroutine scheduling until IO is completed and then continuing to execute previous codes; according to the method, system resources are fully utilized, IO blockage waiting and system resource waste are reduced, the IO processing capacity under high concurrency is greatly improved, and the problems of Accept performance bottleneck and convulsion group can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of high concurrent IO processing, in particular to a method for processing high concurrent IO based on PHP. Background technique

[0002] High concurrency usually refers to processing many requests in parallel at the same time, which is one of the factors that must be considered in the design of distributed system architecture. When the system takes too long to respond to requests, the user experience of Internet products will be greatly reduced.

[0003] In the Internet era, high concurrency usually refers to concurrent access, that is, how many accesses come at the same time at a certain point in time. Usually, the daily PV of a system is more than 10 million, which may be a highly concurrent system.

[0004] At present, most of the concurrent IO solutions use IO multiplexing technology. Linux has long provided the select system call, which can maintain 1024 connections in one process. Later, the poll s...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More