CN106485141A - The detection of abnormal traffic thread and processing method under JAVA environment - Google Patents

The detection of abnormal traffic thread and processing method under JAVA environment Download PDF

Info

Publication number
CN106485141A
CN106485141A CN201610920350.9A CN201610920350A CN106485141A CN 106485141 A CN106485141 A CN 106485141A CN 201610920350 A CN201610920350 A CN 201610920350A CN 106485141 A CN106485141 A CN 106485141A
Authority
CN
China
Prior art keywords
thread
abnormal
time
threads
task
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
CN201610920350.9A
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.)
Tianjin Mass Information Technology Ltd By Share Ltd
Original Assignee
Tianjin Mass Information Technology Ltd By Share 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 Tianjin Mass Information Technology Ltd By Share Ltd filed Critical Tianjin Mass Information Technology Ltd By Share Ltd
Priority to CN201610920350.9A priority Critical patent/CN106485141A/en
Publication of CN106485141A publication Critical patent/CN106485141A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow

Abstract

Under a kind of JAVA environment, the detection of abnormal traffic thread and processing method, comprise the steps:Create the thread of an independent monitoring thread state, this thread is by mastery routine start by set date, the time interval of timing can be analyzed according to practical business, and in Primary Reference practical business, individual task execution is averagely time-consuming, with less than averagely taking as the largest interval time.The task of this thread mainly has following step:Step one:Obtain and preserve the starting time of all working thread, for current the taking of computational threads;Step 2:The abnormal thread of identification;Step 3:Process abnormal thread.The detection of abnormal traffic thread and processing method under a kind of JAVA environment is proposed in the present invention, by monitoring can early pinpoint the problems and solution system present in problem, timely performance data and health status are provided, to be optimized to system or to start remedial measure, the impact caused by reduction accident and disaster when necessary.

Description

The detection of abnormal traffic thread and processing method under JAVA environment
Technical field
The present invention relates to using multithreading Cluster System Technique field and in particular to abnormal under a kind of JAVA environment The detection of business thread and processing method.
Background technology
In the Workflow system of real time processing tasks, in order to improve the concurrency of whole system, sufficiently effective Using resource, inside each working node, often adopt multiple threads mode, the advantage of multithreading is to improve application program Response, makes multiprocessor in hgher efficiency, but there is resource-sharing between multithreading again, the problem of resource contention, if certain Thread has taken necessity resource such as CPU, internal memory, other thread nor normal process task, so, for maintaining the timely of system Smooth run it is desirable to each worker thread must keep stable handling capacity, controlled resources occupation rate, with close speed, The working method of pipeline system is processing individual task.
But the task of Real time request often has a dynamic in reality, unpredictability, the feature such as potential insecurity, The treatment effeciency of each worker thread, take resource situation, result impact must be also unpredictable, this abnormal appointed by limited The overall performance being engaged in causing declines, and needs by developer, multi-threaded system to be monitored.Monitoring technology is a kind of in software Widely used technology in development process, by monitoring can early pinpoint the problems and solution system present in problem, carry For timely performance data and health status, to be optimized to system or to start remedial measure, reduction accident when necessary With the impact caused by disaster.
Content of the invention
The purpose of the present invention is the deficiency existing for existing technology it is proposed that a kind of JAVA environment of high working efficiency Lower abnormal traffic thread detection and processing method.
Technical problem solved by the invention employs the following technical solutions to realize abnormal traffic line under a kind of JAVA environment Journey detection and processing method, comprise the steps:
Step one:Obtain and preserve the starting time of all working thread:Under JAVA environment, each thread broadly falls into certain Sets of threads, sets of threads represents the set of a thread, and sets of threads constitutes one tree, in tree, in addition to initial thread group, each Sets of threads has father's sets of threads, by the initial thread group of top can all of thread in acquisition program, and push up most The sets of threads at end can recall father's thread upwards by current thread, until father's thread of certain father's thread is sky, you can pushed up most The sets of threads at end, a working node program bag thread containing multiple business, there is the thread creating worker thread or have periodic refreshing Data cached thread, the worker thread needing for identification, can be such thread while creating worker thread Take a name carrying special prefix, or thread individually definition one type for real work, by these feature mistakes Leach the thread needing concern, program needs to define an overall Map to preserve the starting time of these threads, when this detection To thread be the new thread opened when, using current time as starting time preservation corresponding with the name of new thread, preserved Remove the normal thread of completed task it is ensured that Map will not increase without limitation afterwards, then from overall Map;
Step 2:The abnormal thread of identification:For ensureing the handling capacity of working node, one highest is set to each thread and runs Time-consuming MaxTimeConsm (s/ms), circulation above-mentioned steps 1 overall Map, deducted with current time each thread startup when Between, calculate currently taking of each thread, when certain thread time-consuming more than MaxTimeConsm, this thread is added to doubtful In the queue of abnormal thread;
Step 3:Process abnormal thread:When thread processes abnormal task, process will present frequent GC, single GC's is time-consuming longer, and old age uses more than 90% state for internal memory, so before processing abnormal thread queue, first obtaining The internal memory service condition of current thread place process, test point is the last GC time, recently twice the interval of GC time and The old age of current process is for internal memory situation, if test point is above the threshold values setting, the provable line currently taking overlength There is abnormal task in journey, subsequently then transfer at unified preservation the task in abnormal thread queue at for subsequent analysis Reason, finally, all threads in exception queue is stopped, making system recovery steady statue.
Beneficial effects of the present invention are:Propose the detection of abnormal traffic thread and processing method under a kind of JAVA environment, lead to Cross monitoring can early pinpoint the problems and solution system present in problem, timely performance data and health status are provided, To be optimized to system or to start remedial measure, the impact caused by reduction accident and disaster when necessary.
Specific embodiment
The multidimensional characteristic combination logic detection method of the present invention comprises the following steps:Create an independent monitoring thread shape The thread of state, this thread can be analyzed according to practical business by mastery routine start by set date, the time interval of timing, and Primary Reference is actual In business, individual task execution is averagely time-consuming, with less than averagely taking as the largest interval time.The task of this thread is main There is following step:
Step one:Obtain and preserve the starting time of all working thread:Under JAVA environment, each thread broadly falls into certain Sets of threads, sets of threads represents the set of a thread.Additionally, sets of threads can also comprise other sets of threads.Sets of threads constitutes one Tree, in tree, in addition to initial thread group, each sets of threads has father's sets of threads.By the initial thread of top Group can all of thread in acquisition program, and the sets of threads of top can recall father's thread upwards by current thread, until certain Father's thread of individual father's thread is sky, you can obtain the sets of threads of top.One working node program bag thread containing multiple business, Have and create the thread of worker thread, have data cached thread of periodic refreshing etc., in order to identify the worker thread needing concern, Can be that such thread takes a name carrying special prefix when creating worker thread, or be real work Thread individually defines a type, goes out to need the thread of concern by these characteristic filter.Program needs to define an overall Map To preserve the starting time of these threads, when the thread that this detects is the new thread opened, using current time as opening The preservation corresponding with the name of new thread of dynamic time, after having preserved, then the normal line removing the task of having completed from overall Map Journey is it is ensured that Map will not increase without limitation.
Step 2:The abnormal thread of identification:For ensureing the handling capacity of working node, one highest is set to each thread and runs Time-consuming MaxTimeConsm (s/ms), circulation above-mentioned 1. in overall Map, deducted with current time each thread startup when Between, calculate currently taking of each thread, when certain thread time-consuming more than MaxTimeConsm, this thread is added to doubtful In the queue of abnormal thread;
Step 3:Process abnormal thread:When thread processes abnormal task, process will present frequent GC, single GC's is time-consuming longer, and old age uses more than 90% state for internal memory, so before processing abnormal thread queue, first obtaining The internal memory service condition of current thread place process, test point is the last GC time, recently twice the interval of GC time and The old age of current process is for internal memory situation, if test point is above the threshold values setting, the provable line currently taking overlength There is abnormal task in journey, subsequently then transfer at unified preservation the task in abnormal thread queue at for subsequent analysis Reason, finally, all threads in exception queue is stopped, making system recovery steady statue.
The present invention proposes the detection of abnormal traffic thread and processing method under a kind of JAVA environment, can be early by monitoring Pinpoint the problems and solution system present in problem, provide timely performance data and health status, to carry out to system Optimize or start remedial measure, the impact caused by reduction accident and disaster when necessary.
Those of ordinary skill in the art should be understood:More than, the described specific embodiment being only the present invention, and It is not used in the restriction present invention, all any modification, equivalent substitution and improvement within the spirit and principles in the present invention, done etc., all Should be included within protection scope of the present invention.

Claims (1)

1. under a kind of JAVA environment abnormal traffic thread detection with processing method it is characterised in that:Comprise the steps:
Step one:Obtain and preserve the starting time of all working thread:Under JAVA environment, each thread broadly falls into certain thread Group, sets of threads represents the set of a thread, and sets of threads constitutes one tree, in tree, in addition to initial thread group, each thread Group has father's sets of threads, by the initial thread group of top can all of thread in acquisition program, and top Sets of threads can recall father's thread upwards by current thread, until father's thread of certain father's thread is sky, you can obtain top Sets of threads, a working node program bag thread containing multiple business, there is the thread creating worker thread or have periodic refreshing to cache The thread of data, the worker thread needing for identification, one can be taken for such thread while creating worker thread The individual name with special prefix, or thread individually definition one type for real work, are gone out by these characteristic filter Need the thread of concern, program needs to define an overall Map to preserve the starting time of these threads, when this detects When thread is the new thread opened, current time is preserved as starting time is corresponding with the name of new thread, after having preserved, then Remove the normal thread of the task of having completed it is ensured that Map will not increase without limitation from overall Map;
Step 2:The abnormal thread of identification:For ensureing the handling capacity of working node, one highest operation is set to each thread time-consuming MaxTimeConsm (s/ms), the overall Map of circulation above-mentioned steps 1, deduct the starting time of each thread, meter with current time Calculate currently taking of each thread, when certain thread time-consuming more than MaxTimeConsm, this thread is added to doubtful exception In the queue of thread;
Step 3:Process abnormal thread:When thread processes abnormal task, process will present frequent GC, single GC's Take longer, and old age uses more than 90% state for internal memory, so before processing abnormal thread queue, first obtaining current The internal memory service condition of thread place process, test point is the last GC time, the interval of GC time and current twice recently The old age of process is for internal memory situation, if test point is above the threshold values setting, in the thread of provable currently time-consuming overlength There is abnormal task, subsequently then the task in abnormal thread queue is transferred to so that subsequent analysis are processed at unified preservation, Afterwards, all threads in exception queue are stopped, making system recovery steady statue.
CN201610920350.9A 2016-10-21 2016-10-21 The detection of abnormal traffic thread and processing method under JAVA environment Pending CN106485141A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610920350.9A CN106485141A (en) 2016-10-21 2016-10-21 The detection of abnormal traffic thread and processing method under JAVA environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610920350.9A CN106485141A (en) 2016-10-21 2016-10-21 The detection of abnormal traffic thread and processing method under JAVA environment

Publications (1)

Publication Number Publication Date
CN106485141A true CN106485141A (en) 2017-03-08

Family

ID=58269861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610920350.9A Pending CN106485141A (en) 2016-10-21 2016-10-21 The detection of abnormal traffic thread and processing method under JAVA environment

Country Status (1)

Country Link
CN (1) CN106485141A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107479986A (en) * 2017-07-03 2017-12-15 阿里巴巴集团控股有限公司 The control method and device of service traffics
CN108446162A (en) * 2018-02-13 2018-08-24 南京途牛科技有限公司 Monitor the method and system of JVM Full GC events
CN108563581A (en) * 2018-04-25 2018-09-21 咪咕文化科技有限公司 Abnormality detection processing method and processing device, electronic equipment and computer storage media
CN108647128A (en) * 2018-05-17 2018-10-12 重庆市通信建设有限公司 Concurrent step sorting technique, device and electronic equipment
CN109324946A (en) * 2018-09-10 2019-02-12 天津字节跳动科技有限公司 Operational monitoring method, apparatus, electronic equipment and computer readable storage medium
CN109586989A (en) * 2017-09-28 2019-04-05 阿里巴巴集团控股有限公司 A kind of state detection method, device and group system
CN111767192A (en) * 2020-06-30 2020-10-13 平安国际智慧城市科技股份有限公司 Service data detection method, device, equipment and medium based on artificial intelligence
CN112416725A (en) * 2020-11-02 2021-02-26 北京三快在线科技有限公司 Pressure testing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281458A (en) * 2008-05-14 2008-10-08 华为技术有限公司 Apparatus, system and for recycling rubbish
CN101599027A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of thread pool management method and system thereof
CN103514102A (en) * 2013-10-25 2014-01-15 中国联合网络通信集团有限公司 Memory garbage collecting method and device for Java virtual machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281458A (en) * 2008-05-14 2008-10-08 华为技术有限公司 Apparatus, system and for recycling rubbish
CN101599027A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of thread pool management method and system thereof
CN103514102A (en) * 2013-10-25 2014-01-15 中国联合网络通信集团有限公司 Memory garbage collecting method and device for Java virtual machine

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107479986A (en) * 2017-07-03 2017-12-15 阿里巴巴集团控股有限公司 The control method and device of service traffics
CN109586989A (en) * 2017-09-28 2019-04-05 阿里巴巴集团控股有限公司 A kind of state detection method, device and group system
CN108446162A (en) * 2018-02-13 2018-08-24 南京途牛科技有限公司 Monitor the method and system of JVM Full GC events
CN108446162B (en) * 2018-02-13 2021-11-26 南京途牛科技有限公司 Method and system for monitoring JVM Full GC event
CN108563581A (en) * 2018-04-25 2018-09-21 咪咕文化科技有限公司 Abnormality detection processing method and processing device, electronic equipment and computer storage media
CN108647128A (en) * 2018-05-17 2018-10-12 重庆市通信建设有限公司 Concurrent step sorting technique, device and electronic equipment
CN109324946A (en) * 2018-09-10 2019-02-12 天津字节跳动科技有限公司 Operational monitoring method, apparatus, electronic equipment and computer readable storage medium
CN111767192A (en) * 2020-06-30 2020-10-13 平安国际智慧城市科技股份有限公司 Service data detection method, device, equipment and medium based on artificial intelligence
CN112416725A (en) * 2020-11-02 2021-02-26 北京三快在线科技有限公司 Pressure testing method and device

Similar Documents

Publication Publication Date Title
CN106485141A (en) The detection of abnormal traffic thread and processing method under JAVA environment
CN106802826B (en) Service processing method and device based on thread pool
JP6845338B2 (en) Distributed hardware tracing
US20110225586A1 (en) Intelligent Transaction Merging
US20100223446A1 (en) Contextual tracing
CN102902589B (en) The management of a kind of cluster MIC operation and dispatching method
CN103927305B (en) It is a kind of that the method and apparatus being controlled is overflowed to internal memory
CN107451012A (en) A kind of data back up method and stream calculation system
CN108733464A (en) A kind of method and device of the scheduling scheme of determining calculating task
WO2021253851A1 (en) Cluster distributed resource scheduling method, apparatus and device, and storage medium
CN115150471B (en) Data processing method, apparatus, device, storage medium, and program product
CN111813635A (en) Monitoring method, system and device for intelligent contracts of block chains
CN103235754B (en) The treating method and apparatus of request in distributed file system
CN112181748A (en) Concurrent test method, device, equipment and storage medium based on ring queue
CN105610899A (en) Text file parallel uploading method and device
CN112860651A (en) Task log analysis method, system, computer device and storage medium
GB2604279A (en) Debugging and profiling of machine learning model training
CN107391283A (en) A kind of message treatment method and device
CN107526622A (en) Rapid exception handling method and device for Linux
CN110457133A (en) A kind of processing method and system of operating-system resources exception
CN103955397A (en) Virtual machine scheduling multi-strategy selection method based on micro-architecture perception
CN109117247B (en) Virtual resource management system and method based on heterogeneous multi-core topology perception
CN107368351B (en) Automatic upgrading and capacity expanding method and device for virtual machine configuration
CN104391732A (en) Software multi-timer dynamic state management method
CN108121605A (en) A kind of cgroup memory control optimization methods and system based on yarn

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170308