CN114064141A - Middleware starting time optimization method and device and readable storage medium - Google Patents

Middleware starting time optimization method and device and readable storage medium Download PDF

Info

Publication number
CN114064141A
CN114064141A CN202111231778.XA CN202111231778A CN114064141A CN 114064141 A CN114064141 A CN 114064141A CN 202111231778 A CN202111231778 A CN 202111231778A CN 114064141 A CN114064141 A CN 114064141A
Authority
CN
China
Prior art keywords
starting
middleware
optimization method
items
started
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111231778.XA
Other languages
Chinese (zh)
Inventor
计刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yonyou Network Technology Co Ltd
Original Assignee
Yonyou Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yonyou Network Technology Co Ltd filed Critical Yonyou Network Technology Co Ltd
Priority to CN202111231778.XA priority Critical patent/CN114064141A/en
Publication of CN114064141A publication Critical patent/CN114064141A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a middleware starting time optimization method, a middleware starting time optimization device and a readable storage medium. The middleware starting time optimization method comprises the steps of obtaining starting time sequences of a plurality of starting items and the dependency relationship of the plurality of starting items when the middleware is started; and reordering the starting time sequences of the plurality of starting items according to the dependency relationship of the plurality of starting items, starting the starting items with the dependency relationship according to the dependency relationship, starting the starting items without the dependency relationship in parallel, and realizing multithread synchronization by locking when each starting item is started. The technical scheme of the invention obviously shortens the starting time compression of the middleware by reordering and parallel processing the starting time sequence of the starting item in the middleware, improves the utilization rate of software, reduces the human capital, improves the customer experience and increases the customer satisfaction.

Description

Middleware starting time optimization method and device and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for optimizing the starting time of middleware and a readable storage medium.
Background
In enterprise management software (e.g., a friend NC product or a friend NCC product), it takes a lot of time, generally 10 minutes or more, to start the middleware once, and for developers or implementers who need to restart the middleware many times each day, it takes time each day, and the like, to increase human capital.
The WAS cluster (IBM websphere for application cluster) also needs to wait for a period of time when starting up once, and during the waiting time, the client system cannot be used, which reduces the customer satisfaction.
After the middleware is restarted, the time for logging in the system for the first time is about two minutes, so that the use experience of a client is poor.
Disclosure of Invention
The present invention is directed to solving or improving at least one of the above technical problems.
To this end, a first object of the present invention is to provide a middleware activation time period optimization method.
A second object of the present invention is to provide a middleware start-up time period optimizing apparatus.
A third object of the present invention is to provide a readable storage medium.
In order to achieve the first object of the present invention, the technical solution of the present invention provides a middleware start time optimization method, including: acquiring starting time sequences of a plurality of starting items and the dependency relationship of the plurality of starting items when the middleware is started; and reordering the starting time sequences of the plurality of starting items according to the dependency relationship of the plurality of starting items, starting the starting items with the dependency relationship according to the dependency relationship, starting the starting items without the dependency relationship in parallel, and realizing multithread synchronization by locking when each starting item is started.
According to the technical scheme, the starting time sequence of the starting items in the middleware is reordered and processed in parallel, so that the starting time compression of the middleware is obviously shortened, the utilization rate of software is improved, the human capital is reduced, the customer experience is improved, and the customer satisfaction is increased. In the technical scheme, multithreading synchronization is realized through locking when each starting item is started, and the reliability of the time sequence can be ensured.
In addition, the technical scheme provided by the invention can also have the following additional technical characteristics:
in the above technical solution, the method for optimizing the starting duration of the middleware further includes: after starting the data source and the plurality of underlying activity components, a web application service (web context) is started in parallel.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: setting metadata needing to be loaded in advance; and for the metadata loaded in advance, loading is carried out before the startup of each module (module) class of the product is completed and an http protocol connector (http connector) is started.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: setting a movable assembly started in a delayed mode; for an active component that is started late, the start is performed after the http connector start is completed and a response is opened.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: when the software is logged in, the software is logged in by using a set language.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: and multithreading parallel loading is adopted for classes under modules, so that the granularity of the lock is reduced when the class loader carries out class loading.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: tomcat web containers load web contexts in parallel through a chain of responsibility pattern using multiple threads.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: and after the starting time sequences of the plurality of starting items are reordered, based on multi-thread starting, the encapsulation of the class is adjusted.
In any of the above technical solutions, the method for optimizing the starting duration of the middleware further includes: and adjusting configuration parameters in the Java virtual machine to reduce the starting time of the middleware.
In order to achieve the third object of the present invention, the technical solution of the present invention provides a middleware start-up duration optimization device, including: the device comprises a memory and a processor, wherein the memory stores programs or instructions, and the processor executes the programs or instructions; when the processor executes the program or the instruction, the steps of the middleware starting time length optimization method according to any technical scheme of the invention are realized.
The middleware starting duration optimizing device provided by the technical scheme realizes the steps of the middleware starting duration optimizing method according to any one of the technical schemes of the invention, so that the middleware starting duration optimizing device has all the beneficial effects of the middleware starting duration optimizing method according to any one of the technical schemes of the invention, and is not described herein again.
To achieve the fourth object of the present invention, the technical solution of the present invention provides a readable storage medium, where a program or an instruction is stored, and when the program or the instruction is executed, the steps of the middleware starting time duration optimization method according to any one of the above technical solutions are implemented.
The readable storage medium provided in this technical solution implements the steps of the middleware starting duration optimization method according to any one of the technical solutions of the present invention, and thus has all the beneficial effects of the middleware starting duration optimization method according to any one of the technical solutions of the present invention, which are not described herein again.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart of a middleware boot time optimization method according to one embodiment of the present invention;
FIG. 2 is a second flowchart of a middleware boot time optimization method according to an embodiment of the present invention;
FIG. 3 is a third flowchart of a middleware activation duration optimization method according to an embodiment of the present invention;
FIG. 4 is a fourth flowchart of a middleware boot time optimization method according to an embodiment of the present invention;
FIG. 5 is a flowchart of a middleware boot time optimization method according to one embodiment of the present invention;
FIG. 6 is a flowchart of a middleware boot time optimization method according to a sixth embodiment of the present invention;
FIG. 7 is a seventh flowchart of a middleware boot time optimization method according to one embodiment of the present invention;
FIG. 8 is an eighth flowchart of a middleware boot time optimization method according to one embodiment of the present invention;
FIG. 9 is a ninth flowchart of a middleware boot time optimization method according to one embodiment of the present invention;
FIG. 10 is a schematic diagram of the middleware start-up duration optimization apparatus according to an embodiment of the present invention;
FIG. 11 is one of the stack diagrams illustrating grabbing during downtime according to one embodiment of the invention;
FIG. 12 is a second illustration of a stack for grabbing while down according to one embodiment of the present invention;
FIG. 13 is a diagram illustrating null pointer exceptions, according to an embodiment of the present invention.
Wherein, the correspondence between the reference numbers and the names of the components in fig. 10 is:
200: middleware activation duration optimizing means, 210: memory, 220: a processor.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
Middleware activation time period optimization methods, apparatuses, and readable storage media according to some embodiments of the present invention are described below with reference to fig. 1 to 13.
Example 1:
as shown in fig. 1, the present embodiment provides a middleware start time optimization method, including the following steps:
step S102, acquiring starting time sequences of a plurality of starting items and dependency relations of the plurality of starting items when the middleware is started;
and S104, reordering the starting time sequences of the plurality of starting items according to the dependency relationship of the plurality of starting items, starting the starting items with the dependency relationship according to the dependency relationship, starting the starting items without the dependency relationship in parallel, and realizing multithread synchronization by locking when each starting item is started.
In the related art, a main process started by middleware of enterprise management software (for example, a friend NC product or a friend NCC product, including a friend NC6.3 product, a friend NC6.5 product, a friend NCC1909 product, a friend NCC2005 product, a friend NCC for EPM product, and the like) has only one single thread being loaded, the NC/NCC middleware starts by scanning the rop.xml core configuration information of nchome first, loading a tomcat web container, an ejb (enterprise Java beans) container, and a data source, then starting scanning an interface class under a module in a listener of the tomcat web, and finally continuing to load each web context.
For larger projects, such as a larger number of modules and a larger amount of client data, or a larger number of unfinished tasks in an IUFO (report of NC) calculation queue in a cluster scheduler, and scenes in which an early warning and a background task are to be executed in a UAP (Unified Application Platform, UAP) scheduler, middleware starting may consume a large amount of time in a module loading link, increase human capital, and reduce client satisfaction.
For example, the embodiment can be used in NC or NCC to optimize the middleware start-up duration.
In the embodiment, firstly, the starting time sequences of a plurality of starting items and the dependency relations of the plurality of starting items when the middleware is started are obtained, then, the original time sequence structure is disassembled, all links are started in parallel as much as possible, the starting time sequences of the plurality of starting items are reordered according to the dependency relations of the plurality of starting items, the starting items with the dependency relations are started according to the dependency relations, the starting items without the dependency relations are started in parallel, and multithreading synchronization is realized by locking when all the starting items are started.
According to the embodiment, the starting time sequence of the starting item in the middleware is reordered and processed in parallel, so that the starting time compression of the middleware is obviously shortened, the utilization rate of software is improved, the human capital is reduced, the customer experience is improved, and the customer satisfaction is increased.
In this embodiment, when each start item is started, multithread synchronization is realized through locking, and the reliability of the time sequence can be ensured.
Example 2:
as shown in fig. 2, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S202, starting the data source and the plurality of basic activity components, and starting the web context in parallel.
In the embodiment, the data source and the plurality of basic activity components need to be loaded at the first time, the web context can be loaded in parallel later, and the parts are locked to realize thread synchronization, so that the time sequence is reliable.
Example 3:
as shown in fig. 3, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S302, setting metadata needing to be loaded in advance;
step S304, aiming at the metadata loaded in advance, loading is carried out before the modules are started up and the http connector is started.
In this embodiment, according to an actual situation, metadata to be loaded in advance is set, and after a module class is loaded, a part of metadata to be loaded in advance is loaded before an http connector is opened, so that the first user login waiting time is reduced as much as possible.
Example 4:
as shown in fig. 4, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S402, setting a movable assembly for delayed starting;
in step S404, for the active component that is started in a delayed manner, the start is performed after the http connector is started and a response is opened.
In this embodiment, the active component that can be delayed to be loaded is set according to an actual situation, for example, the active component that can be delayed to be loaded may be a search service, an early warning and background task, a time service, a cluster message, and the like, and for the active component that is delayed to be started, the start is performed after the http connector is started and a response is opened.
In this embodiment, for the compute queue scheduled by the cluster, the load may not be delayed, so as to prevent the waiting user from requesting the IUFO compute service at the first time, because an asynchronous thread does not have a great influence when the middleware performs the multithreading parallel load.
Example 5:
as shown in fig. 5, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S502, when the software is logged in, the software is logged in by adopting a set language.
In the related art, the multi-language framework is heavy in design, so that most non-multi-language users bear unnecessary resource loading of a few multi-language users, multi-language processing related to login is simplified in the embodiment, set language information is directly provided, multi-language resources are not searched, and the starting time of the middleware can be further reduced.
The multi-language framework originally set in the general product has larger workload if being modified, and the embodiment can directly adopt the set language to log in based on the requirements of most users, and optimizes the starting time of the middleware under the condition of hardly generating cost.
Example 6:
as shown in fig. 6, the present embodiment provides a middleware starting time period optimizing method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S602, multithreading parallel loading is adopted for classes in modules, and the granularity of the lock is reduced when the class loader carries out class loading.
In this embodiment, class loading in modules uses multi-thread parallel, which consumes a lot of time and CPU and disk resources, and a new parallel and small lock-granularity loading manner of Java7 and later versions of ClassLoader (Java class loader) may be used, so that parallel loading efficiency of product components is further improved.
Example 7:
as shown in fig. 7, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
in step S702, the tomcat web container loads the web context in parallel by using multiple threads through the responsibility chain mode.
In this embodiment, when loading each web context in the tomcat web container in the responsibility chain mode, the tomcat web container may adopt multi-thread parallel loading, thereby reducing the starting time of the middleware.
Example 8:
as shown in fig. 8, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S802, after the starting time sequences of the plurality of starting items are reordered, based on multi-thread starting, the encapsulation of the class is adjusted.
In this embodiment, after the multithread transformation, the original class package may need to be adjusted to adapt to the new structure, so that the middleware is smoothly started. For example, two abstract classes, abstract container and abstract generic container, when each module container is loaded in parallel through a thread pool, each thread forms a new implementation class object after multithread transformation, and a public component-dependent private component may not be found in the map of the abstract generic container, and further leads to loading failure of a related active component, such as scheduling failure of a background task, so that after the start timing of a plurality of start items is reordered, package of the class is adjusted based on multithread start, and the map of the abstract generic container is changed to be static, and the above problem is solved.
Example 9:
as shown in fig. 9, the present embodiment provides a middleware start-up duration optimization method, and in addition to the technical features of the foregoing embodiments, the present embodiment further includes the following technical features:
the middleware starting time optimization method further comprises the following steps:
step S902, adjusting configuration parameters in the Java virtual machine to reduce the start-up time of the middleware.
In this embodiment, JVM (Java virtual machine) tuning configuration may be performed, for example, parameters may be modified as follows: -XX: PretenesezeThreshold ═ 8000000, -Xmn512m, -XX: + UseContcmarkSweepGC, which by increasing the above parameters, allows the start-up time of the middleware to be further optimized.
For metadata and some basic archive caches, the objects do not need to be copied multiple times in the young age (COPY), and can go directly to the old age.
In this embodiment, a CMS (current Mark sweet) garbage recycler may be used, which has a better effect than java6 and java8 default ps + po garbage recyclers, and the STW time of the CMS garbage recycler is shorter.
Example 10:
as shown in fig. 10, the present embodiment provides a middleware activation time period optimization apparatus 200, including: a memory 210 and a processor 220, the memory 210 storing programs or instructions, the processor 220 executing the programs or instructions; wherein, the processor 220, when executing the program or the instructions, implements the steps of the middleware activation duration optimization method according to any embodiment of the present invention.
Example 11:
the present embodiment provides a readable storage medium, which stores a program or instructions, and when the program or instructions are executed by a processor, the steps of the middleware starting time duration optimization method in any one of the above embodiments are implemented.
The specific embodiment is as follows:
the following problems exist in the related art: (1) only one single thread is loaded in the main flow started by the NC/NCC middleware. (2) The ejb catalog in the development environment is scanned for too long. (3) Hundreds of modules in the modules directory are scanned and loaded in series at a slow speed. (4) The web context resources for a large number of web applications are slow to load. (5) The multi-language framework is heavy in design, and 99% of non-multi-language users can bear unnecessary resource loading of 1% of multi-language users. (6) The loading time of the metadata and the basic files needs to be adjusted.
In order to solve or improve at least one of the above technical problems, this embodiment provides a method for optimizing the starting duration of a middleware, and for the problem that the middleware waits for a long time when logging in an NC client for the first time after being restarted, a scheme of preloading a metadata cache and performing optimization processing on a part of multilingual resources is adopted. The embodiment performs overall adjustment on the combination dependency relationship and the starting time sequence among the NC module, the WEB container and the EJB container, and greatly improves the starting speed on the premise of ensuring the functions. The embodiment performs parallel processing on the NC module class loading. According to the embodiment, the granularity of the lock during class loader ClassLoader class loading is reduced, and the parallel loading efficiency of the product components is further improved. The present embodiment loads and loads the web context in the tomcat web container. The embodiment performs delayed loading on active components (similar to search service, early warning and background tasks, time service, cluster messages). The present embodiment makes appropriate adjustments to the JVM parameters.
Specifically, the middleware starting time optimization method comprises the following steps:
(1) in the related technology, the time sequence for starting the NC/NCC middleware is to scan the nchome's prop.xml core configuration information to load a tomcat web container, an EJB container and a data source, then start to scan and load an interface class under modules in a tenant of the tomcat web, and finally continue to load all the web contexts.
For larger projects, such as a larger number of modules and a larger amount of client data, or a larger number of unfinished tasks in an IUFO calculation queue in a cluster scheduler, and scenes in which early warning and background tasks are to be executed in a UAP scheduler, the middleware starting consumes a large amount of time in the module loading link.
Therefore, the overall optimization idea of this embodiment is to break up the original time sequence structure, and to enable all links to be started in parallel as much as possible, which has dependency relationships, for example, a data source and 30 basic active components need to be loaded at the first time, web context can be loaded later and open-closed is parallel, and thread synchronization is performed between all parts through locking, thereby ensuring reliable time sequence.
And part of metadata needing to be loaded in advance is loaded just after the modules are loaded and before the http connector is opened, so that the first user login waiting time is reduced as much as possible. The embodiment simplifies the multilingual processing related to login, directly provides Chinese information, does not search multilingual resources, and has larger workload if a universal product modifies a multilingual frame.
The active component that is loaded may be delayed and restarted after the http connector opens a response. As for the cluster-scheduled compute queue, delayed loading may not be needed to prevent waiting users from requesting IUFO compute services for the first time, because the middleware does not have much impact on an asynchronous thread when multithreading loads in parallel.
(2) Class loading under modules uses multi-thread parallel, because a large amount of time and CPU and disk resources are consumed, and a new parallel and small lock granularity loading mode of java7 and later versions of ClassLoader is used as much as possible, two versions of java6 and java7 are provided for NC63 middleware, because the java6 does not support the small lock granularity, and lock competition is severe and effect is relatively poor when the classes are loaded in a multi-thread parallel mode.
After the user-defined class loader is changed into the parallel mode, more benefits can be brought, such as object serialization and deserialization are faster, and garbage recycling is not blocked.
As shown in fig. 11 and fig. 12, for the stack captured when the report query is down for the NCC2005 item, it can be seen that the object serialization triggering class loading, the class loader (tail B338) holds a classloader object lock with a large granularity, which causes related WEB threads to be blocked by the lock, and causes that objects held by a large number Of threads cannot be recovered, which causes an Out Of Memory (OOM).
(3) the tomcat web container can also be multithreaded and parallel when loading each web context through the responsibility chain mode, but the tomcat in the NC63 may have problems in parallel because of the lower version, and the tomcat using the NC65 has no problems. Therefore, the NC63 version of for java6 still uses tomcat of NC63, the NC63 version of for java7 uses tomcat of NC65, and attention needs to be paid to replacing the tomcat version.
(4) After multithreading transformation, the original class encapsulation may need to be adjusted to adapt to the new structure. For example, two abstract classes, an abstract connector and an abstract generic connector, may cause a new problem when each module connector is loaded in parallel through a thread pool, each thread may form a new implementation class object after multithreading transformation, and a private component that a public component depends on may not be found in a map of the abstract generic connector, which may lead to a loading failure of a related active component. For example, the scheduling of the background task fails, and the problem can be solved by changing the map of the abstract generic container to be static.
There are other problems due to the modification, which may be the need to break in again in a new environment, and the problem of triggering the BUG in the product, although the BUG has been broken in the original product. For example, in a shared development environment of NC65, web page initialization may be problematic in servlets (acronyms for Java servlets); also entity metadata (VOMeta) such as NC63 cannot be loaded earlier than class, otherwise statistics in VOMeta are not loaded, which causes a null pointer exception in metadata attribute processing, so classes are loaded as soon as possible, as shown in fig. 13.
(5) The JVM is configured with several parameters, such as-XX: pretenersize threshold 8000000-Xmn512m-XX: NewSize 512m-XX: + usecon cark sweet pace pgc, which in addition to the above parameters, can improve performance by a few more seconds. Metadata and some basic archive caches, these objects can go directly to the old without being COPY many times in the young age. CMS garbage recyclers would be better than the default ps + po garbage recyclers of java6-java8, with the STW time of CMS garbage recyclers being shorter.
In this embodiment, after the original time sequence structure is disassembled, the time sequence after reordering may be:
(1) reading the core configuration information of the prop, and loading the data source, the tomcat web container and the EJB container in parallel.
(2) Reading nc.bs.frame.server.server.xml basic service component configuration, and loading the service therein.
(3) And scanning the configuration files and the loading class files of all folders of the product module in parallel.
(4) The listener and servlet in the web application are loaded in parallel.
(5) The metadata service is loaded.
(6) And opening a monitoring port of the http protocol connector to indicate that the application service is started.
(7) And the active components such as background tasks, early warning services, report calculation services and the like are loaded in a delayed mode.
The embodiment enables the starting time of the middleware to be 1/8 to 1/10 before by disassembling and recombining all components of the middleware, optimizing the process and carrying out parallel processing, thereby greatly improving the daily working efficiency of most NC engineers.
After the middleware is restarted, the first login time is shortened to about 10 seconds from the last two minutes.
In the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance; the term "plurality" means two or more unless expressly limited otherwise. The terms "mounted," "connected," "fixed," and the like are to be construed broadly, and for example, "connected" may be a fixed connection, a removable connection, or an integral connection; "coupled" may be direct or indirect through an intermediary. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the description of the present invention, it is to be understood that the terms "upper", "lower", "left", "right", "front", "rear", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the referred device or unit must have a specific direction, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A middleware starting time optimization method is characterized by comprising the following steps:
acquiring starting time sequences of a plurality of starting items and the dependency relationship of the plurality of starting items when the middleware is started;
and reordering the starting time sequences of the plurality of starting items according to the dependency relationship of the plurality of starting items, starting the starting items with the dependency relationship according to the dependency relationship, starting the starting items without the dependency relationship in parallel, and realizing multithread synchronization by locking when each starting item is started.
2. The middleware start-up duration optimization method according to claim 1, further comprising:
after starting the data source and the plurality of basic activity components, the web application service is started in parallel.
3. The middleware start-up duration optimization method according to claim 1, further comprising:
setting metadata needing to be loaded in advance;
and aiming at the metadata loaded in advance, loading the metadata before the start of each module class of the product is finished and the http protocol connector is started.
4. The middleware start-up duration optimization method according to claim 1, further comprising:
setting a movable assembly started in a delayed mode;
and starting the active component started in a delayed mode after the http protocol connector is started completely and a response is opened.
5. The middleware start-up duration optimization method according to claim 1, further comprising:
when the software is logged in, the software is logged in by using a set language.
6. The middleware start-up duration optimization method according to claim 1, further comprising:
and multithreading parallel loading is adopted for classes under each module of the product, so that the granularity of the lock is reduced when the class loader carries out class loading.
7. The middleware start-up duration optimization method according to claim 1, further comprising:
tomcat web containers load web application services in parallel using multiple threads through a chain of responsibility pattern.
8. The middleware start-up duration optimization method according to claim 1, further comprising:
and after the starting time sequences of the plurality of starting items are reordered, based on multi-thread starting, the encapsulation of the class is adjusted.
9. The middleware start-up duration optimization method according to any one of claims 1 to 8 further comprising:
and adjusting configuration parameters in the Java virtual machine to reduce the starting time of the middleware.
10. A middleware activation duration optimization device (200), comprising:
a memory (210) storing programs or instructions;
a processor (220) that executes the program or instructions;
wherein the processor (220), when executing the program or instructions, implements the steps of the middleware activation duration optimization method according to any one of claims 1 to 9.
11. A readable storage medium, characterized in that the readable storage medium stores thereon a program or instructions, which when executed by a processor, implement the steps of the middleware start-up duration optimization method according to any one of claims 1 to 9.
CN202111231778.XA 2021-10-22 2021-10-22 Middleware starting time optimization method and device and readable storage medium Pending CN114064141A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111231778.XA CN114064141A (en) 2021-10-22 2021-10-22 Middleware starting time optimization method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111231778.XA CN114064141A (en) 2021-10-22 2021-10-22 Middleware starting time optimization method and device and readable storage medium

Publications (1)

Publication Number Publication Date
CN114064141A true CN114064141A (en) 2022-02-18

Family

ID=80235151

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111231778.XA Pending CN114064141A (en) 2021-10-22 2021-10-22 Middleware starting time optimization method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN114064141A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711427A (en) * 2019-10-24 2021-04-27 华为技术有限公司 Method and device for acquiring mirror image file
CN114546534A (en) * 2022-02-28 2022-05-27 百果园技术(新加坡)有限公司 Application page starting method, device, equipment and medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110262847A (en) * 2019-05-14 2019-09-20 百度(中国)有限公司 Application program launching accelerated method, device and machine readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110262847A (en) * 2019-05-14 2019-09-20 百度(中国)有限公司 Application program launching accelerated method, device and machine readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711427A (en) * 2019-10-24 2021-04-27 华为技术有限公司 Method and device for acquiring mirror image file
CN114546534A (en) * 2022-02-28 2022-05-27 百果园技术(新加坡)有限公司 Application page starting method, device, equipment and medium
CN114546534B (en) * 2022-02-28 2023-11-24 百果园技术(新加坡)有限公司 Application page starting method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US11954521B2 (en) Deep learning job scheduling method and system and related device
US8606886B2 (en) System for conversion between physical machines, virtual machines and machine images
US8024425B2 (en) Web services deployment
US8010695B2 (en) Web services archive
US9251498B2 (en) Facilitating deployment of customizations of enterprise applications
CN114064141A (en) Middleware starting time optimization method and device and readable storage medium
US7814060B2 (en) Apparatus and method for web service client deployment
US6430570B1 (en) Java application manager for embedded device
CN112035172B (en) Operating system starting method, device, server and storage medium
Marco et al. The glite workload management system
US8332443B2 (en) Masterless distributed batch scheduling engine
KR101963917B1 (en) Automatic synchronization of most recently used document lists
US20060064399A1 (en) Method and system for testing distributed software applications
CN107077390B (en) Task processing method and network card
US7275183B2 (en) Method of restoring processes within process domain
WO2021082081A1 (en) Method, system and device for dynamically modifying nginx configuration parameters, and storage medium
JP2002358208A (en) System and method for data processing, apparatus and method for information processing, and storage medium
US7743333B2 (en) Suspending a result set and continuing from a suspended result set for scrollable cursors
Duvos et al. An infrastructure for the dynamic distribution of web applications and services
Giuffrida et al. A taxonomy of live updates
US7613710B2 (en) Suspending a result set and continuing from a suspended result set
CN112612428B (en) Method and device for improving performance of Codeigniter frame
US11017032B1 (en) Document recovery utilizing serialized data
CN117493271B (en) Container node management device, method, equipment and medium of cloud operating system
WO2023029955A1 (en) Method for printing dynamic log, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination