CN106559497A - A kind of distributed caching method of WEB server based on daemon thread - Google Patents

A kind of distributed caching method of WEB server based on daemon thread Download PDF

Info

Publication number
CN106559497A
CN106559497A CN201611110871.4A CN201611110871A CN106559497A CN 106559497 A CN106559497 A CN 106559497A CN 201611110871 A CN201611110871 A CN 201611110871A CN 106559497 A CN106559497 A CN 106559497A
Authority
CN
China
Prior art keywords
thread
sentry
web server
caching
data
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
CN201611110871.4A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201611110871.4A priority Critical patent/CN106559497A/en
Publication of CN106559497A publication Critical patent/CN106559497A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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
    • 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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5683Storage of data provided by user terminals, i.e. reverse caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present invention discloses a kind of distributed caching method of WEB server based on daemon thread, is related to WEB server technology, in WEB server operation system aspect, proposes the sentry's thread based on daemon thread principle, is cached by sentry's thread advancing updating;When request thread finds that caching does not have data, each thread removes refresh counter, after renewal, obtains the thread that enumerator is 1, is arranged to sentry's thread, and other common threads then wait sentry's thread.The present invention has saved WEB server cost by the sentry's thread based on daemon thread, advancing updating caching, it is to avoid the service process performance for concurrently causing system delay, enhancing WEB server of big flow.

Description

A kind of distributed caching method of WEB server based on daemon thread
Technical field
The present invention relates to WEB server technology, specifically a kind of WEB server is based on the distributed slow of daemon thread Deposit method.
Background technology
Internet technology development at present is increasingly mature, and the every aspect of people's life has been popularized in shopping online store.On the net There are service traffics low ebb and peak in store, and this has been resulted on shopping online store Flow Experience and WEB server hardware performance Contradiction.In the hardware cluster design architecture of store, WEB service application server constitutes store FEP, in service traffics When underestimating, pressure is less, and pressure is very big at service traffics peak.
Shopping based on B/S frameworks or distribution website, during promoting, certain commodity are carried out with the second kills competition for orders activity, Service traffics can be so made to increase decades of times than usual.The computation model of business is that FEP WEB server concurrently goes to rear end to obtain Data are calculated during treating excess syndrome, result is then combined with, according to user's sequence information to commodity modification attribute etc..It is in this process, big to flow That what is measured concurrently causes system delay.If according to general pressure design store hardware structure, the system in peak traffic can be caused Process performance is low, if designed according to peak, causes cost to waste again.
The content of the invention
Demand and weak point of the present invention for the development of current technology, there is provided a kind of WEB server is based on daemon thread Distributed caching method.
A kind of distributed caching method of the WEB server of the present invention based on daemon thread, solves above-mentioned technical problem Using technical scheme it is as follows:The system that automated back-up changes file in a kind of K-UX operating systems, in WEB server industry Business system level, proposes the sentry's thread based on daemon thread principle, is cached by sentry's thread advancing updating;Work as request thread It was found that when caching does not have data, each thread removes refresh counter, after renewal, the thread that enumerator is 1 is obtained, is arranged to the whistle Soldier's thread, other common threads then wait sentry's thread.
Preferably, sentry's thread realizes that with atomic counters a data have two key, atomic counters key and Data buffer storage key, the two cache-time are consistent, and the atomic counters key out-of-service time is more early than data buffer storage key.
Preferably, when the common thread does not get data, spin+sleep has individual time-out time, if time-out, Request Back end data is selected according to business scenario or processing failure is returned.
Preferably, in first request scene, it is sentry's thread to choose that earliest request, after this thread directly goes End obtains result of calculation and updates caching;Other common threads then spin+sleep wait until sentry's thread update caching after, Till data being taken from caching.
Preferably, in cache invalidation scene, sentry's thread is revived in advance, goes to rear end to obtain and calculates data and update Caching;Other common threads never perceive caching and have failed, and can take newest caching always.
A kind of WEB server of the present invention is had compared with prior art based on the distributed caching method of daemon thread Beneficial effect be:The present invention by the sentry's thread based on daemon thread, advancing updating caching, it is to avoid big flow is concurrently led System delay is caused, the service process performance of WEB server is enhanced, can be good at tackling the pressure of service traffics peak period; WEB server is avoided to arrange according to during peak simultaneously, the phenomenon for causing cost to waste;Present inventive concept is novel, easy to operate, section About WEB server cost.
Description of the drawings
Accompanying drawing 1 is first request scene process figure;
Accompanying drawing 2 is cache invalidation schematic diagram of a scenario.
Specific embodiment
To make the object, technical solutions and advantages of the present invention become more apparent, below in conjunction with specific embodiment, to this A kind of distributed caching method of the bright WEB server based on daemon thread is further described.
The present invention proposes a kind of distributed caching method of WEB server based on daemon thread, in WEB server business system System aspect carries out the distributed caching based on daemon thread, by the sentry's thread based on daemon thread principle, directly goes to rear end Obtain result of calculation advancing updating caching, it is to avoid big flow concurrent and cause system delay.
Embodiment:
Distributed caching method of the WEB server described in the present embodiment based on daemon thread, in WEB server business system layer Face, proposes the sentry's thread based on daemon thread principle, is cached by sentry's thread advancing updating;When request thread finds to cache During without data, each thread removes refresh counter, after renewal, obtains the thread that enumerator is 1, is arranged to sentry's thread, Other common threads then wait sentry's thread.
Sentry's thread realizes that with atomic counters a data have two key, atomic counters key and data to delay Key is deposited, the two cache-time is consistent, but the enumerator key out-of-service times are more early than data buffer storage key, to ensure that sentry updates After caching, do not arrived by other thread awares.
When common thread does not get data, spin+sleep has individual time-out time, prevents fortuitous event;If overtime , request Back end data is selected according to business scenario or processing failure is returned.
Accompanying drawing 1 is first request scene process figure, as shown in Figure 1, in first request scene, chooses earliest that For sentry's thread, this thread will not go read buffer for individual request, directly go to rear end to obtain result of calculation and update caching;Other are general Logical thread then spin+sleep wait until sentry's thread update caching after, till data being taken from caching.
Sentry's thread is responsible for caching and is never failed.Accompanying drawing 2 is cache invalidation schematic diagram of a scenario;As shown in Figure 2, exist In cache invalidation scene, sentry's thread is revived in advance, goes to rear end to obtain and calculates data and update caching;Other common threads are basic Caching will not be perceived to have failed, newest caching can be taken always.
For example:The 12 of the cache invalidation time of certain data key:00:00, if sentry's thread is 11:59:Revive when 55 Wake up, ask rear end and in 11:59:Data cached renewal is completed when 57, then subsequent request thread aware is less than data more Newly, non-expired data can be got always.
Above-mentioned specific embodiment be only the present invention concrete case, the present invention scope of patent protection include but is not limited to Above-mentioned specific embodiment, any person of an ordinary skill in the technical field that meet claims of the present invention and any The appropriate change or replacement done to which, should all fall into the scope of patent protection of the present invention.

Claims (5)

1. the system that automated back-up changes file in a kind of K-UX operating systems, it is characterised in that in WEB server business system System aspect, proposes the sentry's thread based on daemon thread principle, is cached by sentry's thread advancing updating;When request thread finds When caching does not have data, each thread removes refresh counter, after renewal, obtains the thread that enumerator is 1, is arranged to cordon Journey, other common threads then wait sentry's thread.
2. distributed caching method of a kind of WEB server based on daemon thread according to claim 1, it is characterised in that Sentry's thread realizes that with atomic counters a data have two key, atomic counters key and a data buffer storage key, two Person's cache-time is consistent, and the atomic counters key out-of-service time is more early than data buffer storage key.
3. distributed caching method of a kind of WEB server based on daemon thread according to claim 2, it is characterised in that When the common thread does not get data, spin+sleep has individual time-out time, if time-out, is selected according to business scenario Request Back end data returns processing failure.
4. distributed caching method of a kind of WEB server based on daemon thread according to claim 3, it is characterised in that In first request scene, it is sentry's thread to choose earliest that request, and this thread directly goes to rear end to obtain result of calculation And update caching;Other common threads then spin+sleep wait until sentry's thread update caching after, number can be taken from caching According to till.
5. distributed caching method of a kind of WEB server based on daemon thread according to claim 3, it is characterised in that In cache invalidation scene, sentry's thread is revived in advance, goes to rear end to obtain and calculates data and update caching;Other ordinary lines Journey never perceives caching and has failed, and can take newest caching always.
CN201611110871.4A 2016-12-06 2016-12-06 A kind of distributed caching method of WEB server based on daemon thread Pending CN106559497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611110871.4A CN106559497A (en) 2016-12-06 2016-12-06 A kind of distributed caching method of WEB server based on daemon thread

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611110871.4A CN106559497A (en) 2016-12-06 2016-12-06 A kind of distributed caching method of WEB server based on daemon thread

Publications (1)

Publication Number Publication Date
CN106559497A true CN106559497A (en) 2017-04-05

Family

ID=58445166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611110871.4A Pending CN106559497A (en) 2016-12-06 2016-12-06 A kind of distributed caching method of WEB server based on daemon thread

Country Status (1)

Country Link
CN (1) CN106559497A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108536839A (en) * 2018-04-13 2018-09-14 郑州云海信息技术有限公司 Database data deriving method, device, equipment and computer readable storage medium
CN109040183A (en) * 2018-06-27 2018-12-18 郑州云海信息技术有限公司 Node information acquisition method, device, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7991962B2 (en) * 2007-12-10 2011-08-02 International Business Machines Corporation System and method of using threads and thread-local storage
CN104202423A (en) * 2014-09-19 2014-12-10 中国人民财产保险股份有限公司 System for extending caches by aid of software architectures
CN104202424A (en) * 2014-09-19 2014-12-10 中国人民财产保险股份有限公司 Method for extending cache by software architecture

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7991962B2 (en) * 2007-12-10 2011-08-02 International Business Machines Corporation System and method of using threads and thread-local storage
CN104202423A (en) * 2014-09-19 2014-12-10 中国人民财产保险股份有限公司 System for extending caches by aid of software architectures
CN104202424A (en) * 2014-09-19 2014-12-10 中国人民财产保险股份有限公司 Method for extending cache by software architecture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
笑天居士: "一种基于哨兵的分布式缓存设计", 《CSDN》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108536839A (en) * 2018-04-13 2018-09-14 郑州云海信息技术有限公司 Database data deriving method, device, equipment and computer readable storage medium
CN109040183A (en) * 2018-06-27 2018-12-18 郑州云海信息技术有限公司 Node information acquisition method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
Bailis et al. Scalable atomic visibility with RAMP transactions
Akidau et al. Millwheel: Fault-tolerant stream processing at internet scale
Cetintemel et al. S-store: A streaming newsql system for big velocity applications
CN101599027B (en) Thread pool management method and system
CN100359489C (en) Method for internal memory allocation in the embedded real-time operation system
CN103353873B (en) Optimization implementation method and system based on the service of time measure data real-time query
CN106599199A (en) Data caching and synchronization method
CN103425568B (en) log information processing method and device
CN103838604B (en) Method for generating distributed globally unique ID
CN104376096B (en) The method of asynchronous refresh based on buffering area
EP3172668B1 (en) Speculative data processing of streaming data
CN104850627A (en) Method and apparatus for performing paging display
CN105956068A (en) Webpage URL repetition elimination method based on distributed database
CN106470163B (en) Information processing method, device and system
CN106559497A (en) A kind of distributed caching method of WEB server based on daemon thread
CN105183623B (en) A kind of method and apparatus that VDG reconstruction performance is improved based on hot standby VD
CN110018996A (en) A kind of the snapshot rollback method and relevant apparatus of distributed memory system
CN103944964A (en) Distributed system and method carrying out expansion step by step through same
CN106649031A (en) Monitoring data obtaining method and device, and computer
CN108574645A (en) A kind of array dispatching method and device
CN109471989A (en) A kind of page request processing method and relevant apparatus
CN103838762A (en) Uninterrupted data processing device and method based on data table rotation
CN107707621A (en) A kind of method and device for realizing intelligent buffer
CN111444046B (en) Data recovery method and distributed data recovery system
CN103325012A (en) Parallel computing dynamic task distribution method applicable to grid security correction

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170405