GPerf Using Jesque

1,524 views
1,353 views

Published on

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

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,524
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \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

    1. 1. Jesque In Actiongperf framework
    2. 2. Why?Easy Job ConfigurationLow LatencyRedis is Fast Cache NoSQL Queue
    3. 3. And...Phase 2: Redis & Jesque
    4. 4. And...Phase 2: Redis & Jesque
    5. 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. 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. 7. Performance Distributed Grails Web Grails Grails Grails Grails Jesque Jesque Jesque Jesque Redis
    8. 8. Performance Distributed Grails Web Grails Grails Grails Grails Jesque Jesque Jesque Jesque Redis
    9. 9. Sequence Diagram
    10. 10. Dashboards!
    11. 11. Dashboards!
    12. 12. DemoTwitter: @ctoestreichBlog: http://www.christianoestreich.comGPerf: http://bit.ly/zBHd6bGithub: https://www.github.com/ctoestreich

    ×