SlideShare a Scribd company logo
1 of 12
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

What's hot

Trying Continuous Delivery - pyconjp 2012
Trying Continuous Delivery - pyconjp 2012Trying Continuous Delivery - pyconjp 2012
Trying Continuous Delivery - pyconjp 2012
Toru Furukawa
 

What's hot (20)

Scaling up task processing with Celery
Scaling up task processing with CeleryScaling up task processing with Celery
Scaling up task processing with Celery
 
Tdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema RubyTdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema Ruby
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Celery
CeleryCelery
Celery
 
Trying Continuous Delivery - pyconjp 2012
Trying Continuous Delivery - pyconjp 2012Trying Continuous Delivery - pyconjp 2012
Trying Continuous Delivery - pyconjp 2012
 
Celery for internal API in SOA infrastructure
Celery for internal API in SOA infrastructureCelery for internal API in SOA infrastructure
Celery for internal API in SOA infrastructure
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task Queue
 
Celery with python
Celery with pythonCelery with python
Celery with python
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
Capistrano 2 Rocks My World
Capistrano 2 Rocks My WorldCapistrano 2 Rocks My World
Capistrano 2 Rocks My World
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python Celery
 
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir MeetupCachopo - Scalable Stateful Services - Madrid Elixir Meetup
Cachopo - Scalable Stateful Services - Madrid Elixir Meetup
 
kRouter
kRouterkRouter
kRouter
 
The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Designing net-aws-glacier
Designing net-aws-glacierDesigning net-aws-glacier
Designing net-aws-glacier
 
Data processing with celery and rabbit mq
Data processing with celery and rabbit mqData processing with celery and rabbit mq
Data processing with celery and rabbit mq
 
Asynchronous Task Queues with Celery
Asynchronous Task Queues with CeleryAsynchronous Task Queues with Celery
Asynchronous Task Queues with Celery
 
Async programming on NET
Async programming on NETAsync programming on NET
Async programming on NET
 

Viewers also liked

план конспект
план конспектплан конспект
план конспект
savlex
 
Fågeldag
FågeldagFågeldag
Fågeldag
tinzet
 
Vecka 47
Vecka 47Vecka 47
Vecka 47
tinzet
 
現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud
現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud
現代と酷似する 世界恐慌の時代と 帰結としての世界大戦 ①世界恐慌とその反省 ClassOnCloud
Class On Cloud -
 
Raising (funds) athletes
Raising (funds) athletesRaising (funds) athletes
Raising (funds) athletes
Towa Beer
 
Mymentorsaid public deck_tb
Mymentorsaid public deck_tbMymentorsaid public deck_tb
Mymentorsaid public deck_tb
Towa Beer
 
Snogeholm
SnogeholmSnogeholm
Snogeholm
tinzet
 
私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud
私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud 私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud
私塾・義塾の時代 -内田樹blog;「学校教育の終わり」- Class On Cloud
Class On Cloud -
 
Рекомендации
РекомендацииРекомендации
Рекомендации
savlex
 
Методработа Крюкова
Методработа КрюковаМетодработа Крюкова
Методработа Крюкова
savlex
 
Skogen
SkogenSkogen
Skogen
tinzet
 
'12 夏期 経済学セクション グローバル化恐慌の真相 資料
'12 夏期 経済学セクション グローバル化恐慌の真相 資料'12 夏期 経済学セクション グローバル化恐慌の真相 資料
'12 夏期 経済学セクション グローバル化恐慌の真相 資料
Class On Cloud -
 

Viewers also liked (20)

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

Similar to GPerf Using Jesque

How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
Ben Lin
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on Oracle
Raimonds Simanovskis
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Background Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRb
Juan Maiz
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience Report
Anton Arhipov
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copy
Brian Aker
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copy
Brian Aker
 

Similar to GPerf Using Jesque (20)

An Introduction to Celery
An Introduction to CeleryAn Introduction to Celery
An Introduction to Celery
 
Apache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customizationApache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customization
 
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron PattersonDesign Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on Oracle
 
Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...
Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...
Matteo Collina | Take your HTTP server to Ludicrous Speed | Codmeotion Madrid...
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
 
Jeroen Vloothuis Bend Kss To Your Will
Jeroen Vloothuis   Bend Kss To Your WillJeroen Vloothuis   Bend Kss To Your Will
Jeroen Vloothuis Bend Kss To Your Will
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS ApplicationsTest-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
JavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and LodashJavaScript Fundamentals with Angular and Lodash
JavaScript Fundamentals with Angular and Lodash
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
Background Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRbBackground Jobs - Com BackgrounDRb
Background Jobs - Com BackgrounDRb
 
Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)
 
RESTful API using scalaz (3)
RESTful API using scalaz (3)RESTful API using scalaz (3)
RESTful API using scalaz (3)
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience Report
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copy
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copy
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

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

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n