SlideShare a Scribd company logo
Jesque In Action
gperf framework
Why?

Easy Job Configuration
Low Latency
Redis is Fast
    Cache
    NoSQL
    Queue
And...
Phase 2: Redis & Jesque
And...
Phase 2: Redis & Jesque
Creating Jobs
perf {
    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)
    }
}
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)
    }
}
Performance Distributed
              Grails Web

 Grails   Grails           Grails   Grails

 Jesque   Jesque           Jesque   Jesque




                   Redis
Performance Distributed
              Grails Web

 Grails   Grails           Grails   Grails

 Jesque   Jesque           Jesque   Jesque




                   Redis
Sequence Diagram
Dashboards!
Dashboards!
Demo

Twitter: @ctoestreich
Blog: http://www.christianoestreich.com
GPerf: http://bit.ly/zBHd6b
Github: https://www.github.com/ctoestreich

More Related Content

KEY
Background Jobs with Resque
PDF
Background processing with Resque
KEY
Php resque
PPTX
Capistrano - automate all the things
PPTX
Getting Started with Capistrano
PPT
Capistrano
PDF
Introduction to Celery
PPT
Open Source Saturday - How can I contribute to Ruby on Rails?
Background Jobs with Resque
Background processing with Resque
Php resque
Capistrano - automate all the things
Getting Started with Capistrano
Capistrano
Introduction to Celery
Open Source Saturday - How can I contribute to Ruby on Rails?

What's hot (20)

PDF
Scaling up task processing with Celery
PDF
Tdc 2013 - Ecossistema Ruby
PDF
Infrastructure = code - 1 year later
PDF
Celery
PDF
Trying Continuous Delivery - pyconjp 2012
PDF
Celery for internal API in SOA infrastructure
PDF
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
PDF
Celery: The Distributed Task Queue
PDF
Celery with python
PDF
V2 and beyond
PDF
Capistrano 2 Rocks My World
ODP
Introduction to Python Celery
PDF
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
PDF
kRouter
PDF
The Puppet Master on the JVM - PuppetConf 2014
PPTX
Toolbox of a Ruby Team
PDF
Designing net-aws-glacier
PDF
Data processing with celery and rabbit mq
PPTX
Asynchronous Task Queues with Celery
PPT
Async programming on NET
Scaling up task processing with Celery
Tdc 2013 - Ecossistema Ruby
Infrastructure = code - 1 year later
Celery
Trying Continuous Delivery - pyconjp 2012
Celery for internal API in SOA infrastructure
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Celery: The Distributed Task Queue
Celery with python
V2 and beyond
Capistrano 2 Rocks My World
Introduction to Python Celery
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
kRouter
The Puppet Master on the JVM - PuppetConf 2014
Toolbox of a Ruby Team
Designing net-aws-glacier
Data processing with celery and rabbit mq
Asynchronous Task Queues with Celery
Async programming on NET
Ad

Viewers also liked (20)

PPTX
Yurisprudensi
PDF
план конспект
PDF
What would hhappen if payday loans are outlawed
KEY
Fågeldag
PDF
Colonial historynotespart2
KEY
Vecka 47
PPTX
現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud
PPTX
Raising (funds) athletes
PDF
Reglamento financiero
PPTX
Ed Min Week 7
PDF
Mymentorsaid public deck_tb
KEY
Snogeholm
PPTX
私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud
PDF
Рекомендации
ZIP
Методработа Крюкова
KEY
Skogen
PPTX
Handboek ICT EventsIT
PDF
<legend> presentation
KEY
Vinkelläxa
PDF
'12 夏期 経済学セクション グローバル化恐慌の真相 資料
Yurisprudensi
план конспект
What would hhappen if payday loans are outlawed
Fågeldag
Colonial historynotespart2
Vecka 47
現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud
Raising (funds) athletes
Reglamento financiero
Ed Min Week 7
Mymentorsaid public deck_tb
Snogeholm
私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud
Рекомендации
Методработа Крюкова
Skogen
Handboek ICT EventsIT
<legend> presentation
Vinkelläxa
'12 夏期 経済学セクション グローバル化恐慌の真相 資料
Ad

Similar to GPerf Using Jesque (9)

PPTX
Grails transactions
PDF
[Test bash manchester] contract testing in practice
PDF
Lightbend Lagom: Microservices Just Right
PDF
DataStax | Effective Testing in DSE (Lessons Learned) (Predrag Knezevic) | Ca...
PDF
Effective Testing in DSE
PDF
[Test bash NL] Contract testing in practice with Pact
PDF
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
PPTX
Performance tuning Grails Applications GR8Conf US 2014
PDF
Spark Summit 2014: Spark Job Server Talk
Grails transactions
[Test bash manchester] contract testing in practice
Lightbend Lagom: Microservices Just Right
DataStax | Effective Testing in DSE (Lessons Learned) (Predrag Knezevic) | Ca...
Effective Testing in DSE
[Test bash NL] Contract testing in practice with Pact
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Performance tuning Grails Applications GR8Conf US 2014
Spark Summit 2014: Spark Job Server Talk

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Cloud computing and distributed systems.
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Cloud computing and distributed systems.
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
CIFDAQ's Market Insight: SEC Turns Pro Crypto
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Monthly Chronicles - July 2025
Chapter 3 Spatial Domain Image Processing.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

GPerf Using Jesque

  • 2. Why? Easy Job Configuration Low Latency Redis is Fast Cache NoSQL Queue
  • 5. Creating Jobs perf { 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
  • 12. Demo Twitter: @ctoestreich Blog: http://www.christianoestreich.com GPerf: http://bit.ly/zBHd6b Github: https://www.github.com/ctoestreich

Editor's Notes