This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service { | |
extend "../../../services/tomcat" | |
numInstances 4 | |
minAllowedInstances 4 | |
maxAllowedInstances 10 | |
locationAware true | |
minAllowedInstancesPerLocation 2 | |
maxAllowedInstancesPerLocation 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+ | |
| Load Balancer | | |
+--------+----------+ | |
| | |
| | |
+----------------+---------+------+---------------+---------------+ | |
| | | | | | |
+------+-----+ +------+-----+ +------+-----+ +------+-----+ +------+-----+ | |
| Web Server | | Web Server | | Web Server | | Web Server | | Web Server | | |
| Location 1 | | Location 1 | | Location 2 | | Location 2 | | Location 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+ | |
| Load Balancer | | |
+--------+----------+ | |
| | |
| | |
+ + +------+---------------+---------------+ | |
| | | | | | |
+------+-----+ +------+-----+ +------+-----+ +------+-----+ +------+-----+ | |
| Web Server | | Web Server | | Web Server | | Web Server | | Web Server | | |
| Location 1 | | Location 1 | | Location 2 | | Location 2 | | Location 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+ | |
| Load Balancer | | |
+--------+----------+ | |
| | |
| | |
+ + +------+---------------+ | |
| | | | | |
+------+-----+ +------+-----+ +------+-----+ +------+-----+ | |
| Web Server | | Web Server | | Web Server | | Web Server | | |
| Location 1 | | Location 1 | | Location 2 | | Location 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-------------------+ | |
| Load Balancer | | |
+--------+----------+ | |
| | |
| | |
+----------------+---------+------+---------------+ | |
| | | | | |
+------+-----+ +------+-----+ +------+-----+ +------+-----+ | |
| Web Server | | Web Server | | Web Server | | Web Server | | |
| Location 1 | | Location 1 | | Location 2 | | Location 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalingRule { | |
serviceStatistics { | |
metric "counter" | |
movingTimeRangeInSeconds 5 | |
statistics Statistics.averageOfAverages | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AtomicLong counter = new AtomicLong(0); | |
// expose counter as a monitor | |
monitors ([ | |
"counter" : { | |
return counter.get(); | |
}]) | |
// inject counter value | |
customCommands ([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalingRule { | |
serviceStatistics { | |
metric "Total Requests Count" | |
movingTimeRangeInSeconds 20 | |
statistics Statistics.maximumThroughput | |
} | |
highThreshold { | |
value 1 // request per second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin { | |
name "jmx" | |
className "org.cloudifysource.usm.jmx.JmxMonitor" | |
config([ | |
"Total Requests Count": [ | |
"Catalina:type=GlobalRequestProcessor,name=\"http-bio-${httpPort}\"", | |
"requestCount" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new Service object and initialize it with this closure | |
service { | |
//calls setName(), setType(), etc... | |
name "tomcat" | |
type "WEB_SERVER" | |
numInstances 1 | |
// context is injected automatically | |
def portIncrement = |