GPerf Using Jesque
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

GPerf Using Jesque

on

  • 1,397 views

An example usage of Jesque & Redis to perform performance loads using grails services.

An example usage of Jesque & Redis to perform performance loads using grails services.

Statistics

Views

Total Views
1,397
Views on SlideShare
1,397
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

GPerf Using Jesque Presentation Transcript

  • 1. Jesque In Actiongperf framework
  • 2. Why?Easy Job ConfigurationLow LatencyRedis is Fast Cache NoSQL Queue
  • 3. And...Phase 2: Redis & Jesque
  • 4. And...Phase 2: Redis & Jesque
  • 5. Creating Jobsperf { runners { largeNumberPerformanceRunner { description = Large Number Performance Test maxWorkers = 20 workerClass = com.perf.runners.math.LargeNumberPerformanceService } }}class LargeNumberPerformanceService extends AbstractPerformanceService { Result performTest() { Long result = 1 def executionTime = benchmark { 100000.times { result += it } } new SimpleResult(testName: Long Number Performance Service, executionTime: executionTime) }}
  • 6. The Jesque Job class PerformanceRunnerJob { GrailsApplication grailsApplication RedisService redisService ResultsService resultsService def executorService def perform(jobName, workers) { println "jesque queueing up job ${jobName} with ${workers} threads" Class clazz = grailsApplication.config?.perf?.runners[jobName]?.workerClass if(!clazz) { log.error "Can not start a performance worker without a workerClass defined in the config attribute" } PerformanceService service = (PerformanceService) grailsApplication.mainContext.getBean(clazz) Integer.parseInt(workers).times { runAsync { println "running ${jobName} on thread :: ${Thread.currentThread().id}" while(redisService.get(jobName) == PerformanceConstants.RUNNING) { saveResults(jobName, service.performTest()) } } } } private void saveResults(String jobName, Result result) { log.debug result resultsService.saveResults(jobName, result) }}
  • 7. Performance Distributed Grails Web Grails Grails Grails Grails Jesque Jesque Jesque Jesque Redis
  • 8. Performance Distributed Grails Web Grails Grails Grails Grails Jesque Jesque Jesque Jesque Redis
  • 9. Sequence Diagram
  • 10. Dashboards!
  • 11. Dashboards!
  • 12. DemoTwitter: @ctoestreichBlog: http://www.christianoestreich.comGPerf: http://bit.ly/zBHd6bGithub: https://www.github.com/ctoestreich