CN1256670C - Application server sample pool dynamic configuration method based on real number coding genetic calculation - Google Patents
Application server sample pool dynamic configuration method based on real number coding genetic calculation Download PDFInfo
- Publication number
- CN1256670C CN1256670C CN 200410066417 CN200410066417A CN1256670C CN 1256670 C CN1256670 C CN 1256670C CN 200410066417 CN200410066417 CN 200410066417 CN 200410066417 A CN200410066417 A CN 200410066417A CN 1256670 C CN1256670 C CN 1256670C
- Authority
- CN
- China
- Prior art keywords
- chromosome
- ejb
- application server
- deployment unit
- allocative decision
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present invention relates to a method for dynamically configuring of a sample pool of an application server, which is based on a real number coding genetic algorithm. The application server preliminarily acquires data of access requests of EJB in a deployment unit for a client end, then primary assignment is completed by the real number coding genetic algorithm solving, and subsequently, the current assigning proposal is obtained and is implemented by difference value correction. The steps are periodically executed so as to dynamically regulate the capacity of the sample pool according to the distribution visits of the external client end and to realize automatic and dynamic configuration to the sample pool of th J2EE application server. The present invention takes the total capacity of the sample pool in the deployment unit as a planning goal but does not take the capacity of the single EJB sample pool as the goal so as to provide the possibility of load balancing, to increase the utilization ratio of the resources, to reduce the possibility of a bottleneck caused by the application server end, and to increase the distribution performance of the application server.
Description
Technical field
The present invention relates to a kind of application server instance pool dynamic configuration method, be used for that (Java 2 to J2EE based on Real Coding Genetic Algorithm (RCGA)
NdEnterprise Editon) automatic, dynamic configuration is carried out in the application server instance pond, belongs to J2EE application server design field.
Background technology
According to the J2EE technical manual, J2EE application server EJB (Enterprise Java Bean) container will adopt the example pool technology when EJB is carried out life cycle management, disposes the example pond that will distribute a constant volume when enterprise uses for EJB in internal memory in the J2EE application server.Current application server mainly is to realize appointment to the example tankage promptly preestablishing each EJB example tankage before the EJB deployment unit is disposed by the static configuration technology.What adopt such as the J2EE application server of the Websphere brand of the Weblogic brand of BEA company commonly used on the market and IBM Corporation all is the static configuration technology.The enforcement of static configuration method in engineering is used mainly is to adopt the artificial visit capacity of estimating single EJB during client is to deployment unit, sets the capacity in each example pond then.In the application server operational process, this capacity will be maintained fixed constant.Though this method is convenient to application server realizing, it does not consider the behavioral characteristics of external client visit capacity, can't make dynamic adjustment and adaptation according to the variation of visit capacity, therefore causes the bottleneck of server service logical process easily.Because the static configuration technology is a kind of adopted comparatively naturally example pond collocation method, there is no unified investigative technique document at present, has only the introduction of some using method to sporadically appear in the technical documentation instructions of each J2EE application server product.For dynamic development adjustment aspect, J2EE application server instance pond, still there are not relevant research data and document at present both at home and abroad yet.
Summary of the invention
The objective of the invention is at the deficiencies in the prior art, a kind of application server instance pool dynamic configuration method based on Real Coding Genetic Algorithm is proposed, make the J2EE application server dynamically to adjust the line period that is configured in example pond, thereby alleviate because the static configuration technology causes the degree of the wasting of resources and visit bottleneck easily according to the variation of the requirements for access of client.
For realizing such purpose, the viewpoint that the present invention is based on machine learning has proposed EJB example pool dynamic configuration method, application server is by carrying out data acquisition to client for the request of access of EJB in the deployment unit in advance, majorized function with deployment unit visit degree of Congestion is a fitness function then, sub-distribution is just handled, finished to genetic algorithm by real coding to the data of gathering, and proofreaies and correct by difference subsequently to obtain current allocative decision and implement this allocative decision in a period of time; Periodically carry out said process, just can dynamically adjust the capacity in example pond, realize dynamic-configuration J2EE application server instance pond according to the distribution visit capacity of external client.
The inventive method specifically comprises the steps:
1, data acquisition
At server end, the request of access from client is carried out data sampling, sample frequency can be chosen according to demand voluntarily.If containing the number of EJB in the given EJB deployment unit for the treatment of dynamic-configuration is M, the internal storage location amount that can distribute is N.The data classification of pressing different EJB in the EJB deployment unit of sampling has formed the request of access time series on M the EJB.
2, finish sub-distribution just by the genetic algorithm for solving of real coding
As training data, adopt the genetic algorithm (RCGA) of real coding to generate first allocative decision the rapid resulting request of access time series of previous step.At first carry out chromosome coding, chromosome is designed to M dimension real number vector p, and the example tankage that the value of the component of p (gene) is defined as single EJB accounts for the ratio of total volume, the span of gene be limited to the interval (0,1/M) in; Generate several chromosomes then at random, as initial chromosome colony; By crossover operator, mutation operator and selection operator this chromosome population is carried out hereditary computing then, the gained chromosome population is passed through the screening of fitness function again, generate new chromosome population, and repeating above-mentioned hereditary computing and screening process, the chromosome that final calculating convergence is tried to achieve is exactly pairing allocation proportion in the first allocative decision.
Wherein, described fitness function is the viewpoint from machine learning, is a mathematics majorized function of object of planning structure with the total volume in example pond in the EJB deployment unit, and, in order to solve restricted problem, introduced penalty.Fitness function
Wherein, j is chromosomal component subscript, Γ
L/ N
2Be objective function,
Be penalty; μ (i) is a penalty factor, and initial value is taken as 1, along with population evolution number of times i presses μ (i+1)=μ (i)+i
3Increase.Γ
LDegree of Congestion for the visit EJB deployment unit that sampled data caused passes through following formula
Try to achieve
Wherein, L is the length of sampling data time sequence, and t is the time index of sampled data, and j is the subscript in example pond, and k is the weight in example pond, and q is a sampled data value, and p is a chromosome.
3, obtain allocative decision by the difference correction
At the first allocative decision chromosome of having tried to achieve, at first the value of each component of chromosome is done and is added and handle, deduct the gained result with 1 then, add on each component of chromosome after the difference of gained is divided equally by the component number, allocation proportion to the end.Go multiply by the example pond total volume of deployment unit with the allocation proportion of gained, obtain example pond allocative decision.
4, periodicity embodiment pond allocative decision
In the example pond allocative decision of server end to deployment unit enforcement gained, through all after dates of setting, change step 1 and carry out circular treatment, wherein cycle period should be set with reference to the demand oneself of application system.So just can be by the server robotization, periodically carry out the dynamic-configuration in example pond.
The present invention has utilized the principle of machine learning, a kind of scheme of example pond size being carried out dynamic-configuration has been proposed, can periodically be used to access request data from client, finish the correction of sub-distribution just and difference subsequently by Real Coding Genetic Algorithm after, obtain allocative decision, suitable adjustment and dynamic the tracking are made in the dynamic change of outside client-access request thereby finish.The present invention has realized the automatic dynamic configuration to the example pond, with traditional static technique relatively, the present invention is that the object of planning rather than single EJB example pond are target with the total volume in EJB example pond in the deployment unit, thereby provide the possibility of load balancing, improved the utilization factor of resource, cut down the application server end and caused the possibility of bottleneck, thereby improved the distributed performance of application server.
The genetic algorithm of the real coding that the present invention adopts has implicit parallel processing feature, can avoid the low problem of search efficiency of conventional method, and the while can be avoided big, hamming (Hamming) the steep cliff problem of the calculated amount of binary coding genetic algorithm.The present invention can guarantee to drop in the restriction range by separating of asking of genetic algorithm in conjunction with the designed secondary distribution method of encoding gene interval, avoided the problem of crossing the border of separating that genetic algorithm asks, thereby can guarantee the allocative decision that obtains to optimize, be a kind of method of effectively obtaining Dynamic Assignment fast.
Method of the present invention can be used for the research and development of J2EE application server product, for implementing dynamic-configuration in EJB example pond.
Description of drawings
The workflow diagram of Fig. 1 the invention process dynamic assignment.
The view of the experimental data in Fig. 2 embodiment of the invention.
In Fig. 3 embodiment of the invention according to current gained sampled data gained allocative decision synoptic diagram.
Embodiment
For understanding technical scheme of the present invention better, be further described below in conjunction with accompanying drawing and specific embodiment.
The present invention is based on Real Coding Genetic Algorithm the example pool dynamic configuration method principle as shown in Figure 1.At first the visit capacity of external client is carried out data acquisition, genetic algorithm RCGA by real coding finds the solution and finishes sub-distribution just then, proofread and correct by difference subsequently and finish current allocative decision, deployment unit is implemented the example pond allocative decision of gained at server end, and through after the designated period time T, change step 1 and carry out circular treatment, thereby can dynamically adjust the capacity in example pond, realize dynamic-configuration J2EE application server instance pond according to the distribution visit capacity of external client.
In one embodiment of the invention, experiment parameter sees Table 1.
Table 1 experiment parameter
Main experiment parameter | Parameter value |
Maximum example pool unit | N=10000 |
The number in EJB example to be configured pond | M=20 |
The training data sequence length | L=100 |
Sequence of test data length | L=100 |
The Poisson distribution parameter | λ=N/M=500 |
The set of gene interval | {[0,1/M]}={[0,0.05]} |
The initial population scale | W=100 |
Maximum population evolution number of times imax | 500 |
Penalty factor | μ(i+1)=μ(i)+i 3, μ (0)=1, i is the population algebraically when evolution |
It is as follows that Dynamic Configuration is carried out in application server example pond:
1, data acquisition
At server end, the request of access from client is carried out data sampling, sample frequency is chosen according to demand.If containing the number of EJB in the given EJB deployment unit for the treatment of dynamic-configuration is M, the internal storage location amount that can distribute is N.The data classification of pressing different EJB in the EJB deployment unit of sampling has formed the request of access time series on M the EJB.These time serieses will be as following training data set.Here, in order to make data more representative, present embodiment comes emulation to obtain sampled data by Poisson distribution.According to the waiting line theory theory, be without loss of generality, suppose on M EJB etc. request number sequence to be visited row all obey the λ Poisson distribution.And get λ=N/M.The sequential that can generate a corresponding M length whereby and be 2L is as experimental subjects.Wherein first half is gathered as training data, and latter half is gathered as test data.In order to make the gained data that actual representativeness be arranged, data have been carried out weighted in addition, the access case that these class data can be used as in a kind of reality is similar to a kind of of the uneven visit of different EJB.The last data sequence of gained as shown in Figure 2.
2, finish sub-distribution just by the genetic algorithm for solving of real coding
As training data, adopt the genetic algorithm (RCGA) of real coding to generate first allocative decision the rapid resulting request of access time series of previous step.At first carry out chromosome coding, chromosome is designed to M dimension real number vector p, and the example tankage that the value of the component of p (gene) is defined as single EJB accounts for the ratio of total volume, the span of gene be limited to the interval (0,1/M) in; Generate W chromosome then at random, as initial chromosome colony; By crossover operator, mutation operator and selection operator this chromosome population is carried out hereditary computing then, the gained chromosome population is passed through the screening of fitness function again, generate new chromosome population, and repeating above-mentioned hereditary computing and screening process, the chromosome that final calculating convergence is tried to achieve is exactly pairing allocation proportion in the first allocative decision.
Wherein, crossover operator adopts the array mode of simple intersection, heuristic intersection and arithmetic crossover operator; Mutation operator adopts the array mode of border variation, consistance variation, nonuniformity variation and many nonuniformities mutation operator; Select the sequencing selection function of operator employing based on regular geometric distributions.The structure of fitness function as previously mentioned,
Wherein, j is chromosomal component subscript, Γ
L/ N
2Be objective function,
Be penalty; μ (i) is a penalty factor, and initial value is taken as 1, along with population evolution number of times i presses μ (i+1)=μ (i)+i
3Increase.Γ
LDegree of Congestion for the visit EJB deployment unit that sampled data caused passes through following formula
Try to achieve
Wherein, L is the length of sampling data time sequence, and t is the time index of sampled data, and j is the subscript in example pond, and k is the weight in example pond, and q is a sampled data value, and p is a chromosome.
3, obtain allocative decision by the difference correction
At the first allocative decision chromosome p that has tried to achieve, at first the value of each component is done and is added and handle, deduct the gained result with 1 then, add on each chromosome component after the difference of gained is divided equally by the component number, allocation proportion to the end.Go multiply by the total volume of deployment unit with the allocation proportion of gained, obtain example pond allocative decision.Gained Dynamic Assignment result as shown in Figure 3, the numbering in horizontal ordinate representative instance pond wherein, ordinate is represented corresponding instance pond shared ratio in allocative decision.
4, periodically implement allocative decision
At server end deployment unit is implemented the example pond allocative decision of above-mentioned gained,, change step 1 and carry out circular treatment through all after dates of setting, so just can be, periodically carry out the dynamic-configuration in example pond by the server robotization.
The effect after the enforcement allocative decision and the effect of static configuration scheme are compared, the test result of closing in test data set shows, use the above-mentioned dynamic assignment technology can be so that this deployment unit degree of Congestion descends significantly, in a test period T, compare with the allocation plan that static state is divided equally, the deployment unit degree of Congestion has reduced by 43.72%.
Claims (1)
1, a kind of application server instance pool dynamic configuration method based on Real Coding Genetic Algorithm is characterized in that comprising the steps:
1) data acquisition: at server end, request of access from client is carried out data sampling, if containing the number of EJB in the given EJB deployment unit for the treatment of dynamic-configuration is M, the internal storage location amount that can distribute is N, the classification that the data of sampling are pressed different EJB in the EJB deployment unit forms the request of access time series on M the EJB;
2) finish sub-distribution just by the genetic algorithm for solving of real coding: with the rapid resulting request of access time series of previous step as training data, adopt the genetic algorithm of real coding to generate first allocative decision, at first carry out chromosome coding, chromosome is designed to M dimension real number vector p, the example tankage that the value of the component of p is defined as single EJB accounts for the ratio of total volume, the span of component be limited to the interval (0,1/M) in; Generate several chromosomes at random, as initial chromosome colony; By crossover operator, mutation operator and selection operator this chromosome population is carried out hereditary computing then, the gained chromosome population is passed through the screening of fitness function again, generates new chromosome population; Repeat above-mentioned hereditary computing and screening process, the chromosome that final calculating convergence is tried to achieve is exactly pairing allocation proportion in the first allocative decision; Described fitness function
Wherein, j is chromosomal component subscript, Γ
L/ N
2Be objective function,
Be penalty; μ (i) is a penalty factor, and initial value is taken as 1, along with population evolution number of times i presses μ (i+1)=μ (i)+i
3Increase Γ
LDegree of Congestion for the visit EJB deployment unit that sampled data caused passes through following formula
Try to achieve
Wherein, L is the length of sampling data time sequence, and t is the time index of sampled data, and j is the subscript in example pond, and k is the weight in example pond, and q is a sampled data value, and p is a chromosome;
3) obtain allocative decision by the difference correction: at the first allocative decision chromosome of having tried to achieve, at first the value of each component of chromosome is done and added and handle, deduct the gained result with 1 then, after dividing equally by the component number, the difference of gained adds on each component of chromosome, get allocation proportion to the end, go multiply by the example pond total volume of deployment unit with the allocation proportion of gained, obtain example pond allocative decision;
4) periodicity embodiment pond allocative decision: the example pond allocative decision of deployment unit being implemented gained at server end, through all after dates of setting, change step 1 and carry out circular treatment, thus by the server robotization, periodically carry out the dynamic-configuration in example pond.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200410066417 CN1256670C (en) | 2004-09-16 | 2004-09-16 | Application server sample pool dynamic configuration method based on real number coding genetic calculation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200410066417 CN1256670C (en) | 2004-09-16 | 2004-09-16 | Application server sample pool dynamic configuration method based on real number coding genetic calculation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1588318A CN1588318A (en) | 2005-03-02 |
CN1256670C true CN1256670C (en) | 2006-05-17 |
Family
ID=34603996
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200410066417 Expired - Fee Related CN1256670C (en) | 2004-09-16 | 2004-09-16 | Application server sample pool dynamic configuration method based on real number coding genetic calculation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1256670C (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101515338B (en) * | 2009-03-06 | 2011-08-17 | 山东大学 | Artificial fish-swarm algorithm based on overall information |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7625824B2 (en) * | 2005-06-16 | 2009-12-01 | Oerlikon Usa, Inc. | Process change detection through the use of evolutionary algorithms |
CN101582131B (en) * | 2009-05-27 | 2011-08-10 | 清华大学 | Two dimensional coding and decoding methods of discrete structure genetic optimization |
CN103118136B (en) * | 2013-02-28 | 2015-08-12 | 杭州电子科技大学 | A kind of method based on block rank cloud memory load balance optimizing |
CN104158855B (en) * | 2014-07-24 | 2018-01-02 | 浙江大学 | Information Mobile Service combination based on genetic algorithm calculates discharging method |
CN104980496A (en) * | 2015-05-15 | 2015-10-14 | 江苏博智软件科技有限公司 | Virtual energy-saving dispatching method based on cloud computing load balance |
CN107516020B (en) * | 2017-08-17 | 2021-05-14 | 中国科学院深圳先进技术研究院 | Method, device, equipment and storage medium for determining importance of sequence sites |
CN110096339B (en) * | 2019-05-10 | 2020-08-04 | 重庆八戒电子商务有限公司 | System load-based capacity expansion and contraction configuration recommendation system and method |
CN118101500B (en) * | 2024-04-17 | 2024-06-25 | 西安电子科技大学 | Service deployment method and system under edge environment based on improved genetic algorithm |
-
2004
- 2004-09-16 CN CN 200410066417 patent/CN1256670C/en not_active Expired - Fee Related
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101515338B (en) * | 2009-03-06 | 2011-08-17 | 山东大学 | Artificial fish-swarm algorithm based on overall information |
Also Published As
Publication number | Publication date |
---|---|
CN1588318A (en) | 2005-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2212806B1 (en) | Allocation of resources for concurrent query execution via adaptive segmentation | |
CN107888669B (en) | Deep learning neural network-based large-scale resource scheduling system and method | |
CN102254246B (en) | Workflow managing method and system | |
CN110135635B (en) | Regional power saturated load prediction method and system | |
CN102624865B (en) | Cluster load prediction method and distributed cluster management system | |
CN1256670C (en) | Application server sample pool dynamic configuration method based on real number coding genetic calculation | |
CN102681902A (en) | Load balancing method based on task distribution of multicore system | |
CN112685153A (en) | Micro-service scheduling method and device and electronic equipment | |
CN114253735B (en) | Task processing method and device and related equipment | |
CN110347515B (en) | Resource optimization allocation method suitable for edge computing environment | |
CN112632615B (en) | Scientific workflow data layout method based on hybrid cloud environment | |
CN107357652A (en) | A kind of cloud computing method for scheduling task based on segmentation sequence and standard deviation Dynamic gene | |
CN109460301B (en) | Method and system for configuring elastic resources of streaming data load | |
CN104679590A (en) | Map optimization method and device in distributive calculating system | |
CN113157694A (en) | Database index generation method based on reinforcement learning | |
CN110263059A (en) | Spark-Streaming intermediate data partition method, device, computer equipment and storage medium | |
CN110111001B (en) | Site selection planning method, device and equipment for electric vehicle charging station | |
CN108512817A (en) | More video code conversion dispatching methods and device | |
CN114090239A (en) | Model-based reinforcement learning edge resource scheduling method and device | |
JP7098204B2 (en) | VOD service cache replacement method based on random forest algorithm in edge network environment | |
CN111988412A (en) | Intelligent prediction system and method for multi-tenant service resource demand | |
CN117436627A (en) | Task allocation method, device, terminal equipment and medium | |
Liu et al. | A prediction based iterative decomposition algorithm for scheduling large-scale job shops | |
CN104283934A (en) | WEB service pushing method and device based on reliability prediction and server | |
CN107277824B (en) | Virtual base station clustering method under C-RAN architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C19 | Lapse of patent right due to non-payment of the annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |