Katello on TorqueBox

  • 502 views
Uploaded on

Lukáš Zapletal …

Lukáš Zapletal
Katello on Torquebox / JRuby talk for Developer Conference 2013 Brno Czech Republic (English)

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
502
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. KATELLO ON TORQUEBOX Java Loves Ruby
  • 2. ABOUT MELukáš Zapletal
  • 3. ABOUT ME @lzap
  • 4. ABOUT ME@lzap_CZ @lzap80
  • 5. THEME SELECTION Blah blah blah:Sky - Beige - Simple - Serif - Night - Default
  • 6. KATELLO
  • 7. TORQUEBOX
  • 8. RUBY
  • 9. JRUBY
  • 10. JAVA
  • 11. JAVA
  • 12. CATS-FREE TALK
  • 13. WHAT IS KATELLO
  • 14. KATELLO IS
  • 15. A OPEN-SOURCE
  • 16. CONTENT AND SYSTEM
  • 17. MANAGEMENT STACK
  • 18. FOR DATACENTERS
  • 19. AND CLOUD
  • 20. IF YOU TAKE ...
  • 21. AND CLOUD
  • 22. FOR DATACENTERS
  • 23. AND CLOUD
  • 24. FOR DATACENTERS
  • 25. AND CLOUD
  • 26. ENOUGH FUN!What the cloud is?
  • 27. NISTNational Institute of Standards and Technology
  • 28. NIST DEFINITIONthe NIST definition of cloud computing
  • 29. NIST DEFINITION
  • 30. NIST DEFINITION
  • 31. NIST DEFINITION
  • 32. NIST DEFINITION
  • 33. NIST DEFINITION
  • 34. NIST DEFINITION
  • 35. NIST DEFINITION
  • 36. CLOUD DEFINITION Cloud computing is a model for enabling ubiquitous,convenient, on-demand network access to a shared pool of configurable computing resources.
  • 37. CLOUD DEFINITIONIt can be rapidly provisioned and released with minimal management effort or service provider interaction.
  • 38. ESSENTIAL CHARACTERISTICS on-demand service
  • 39. ESSENTIAL CHARACTERISTICS broad network access
  • 40. ESSENTIAL CHARACTERISTICS resource pooling
  • 41. ESSENTIAL CHARACTERISTICS rapid elasticity
  • 42. ESSENTIAL CHARACTERISTICS measured service
  • 43. SERVICE MODELS SaaS PaaS Iaas
  • 44. DEPLOYMENT MODELS private cloud community cloud hybrid cloud public cloud
  • 45. WHAT YOU CAN DO WITH KATELLO?
  • 46. RED HAT SUBSCRIPTION what is it and how it works
  • 47. SUBSCRIPTION MANAGEMENTimport Red Hat subscriptions from Portalcreate your own products and subscriptionsregister machines and consume themsee some statistics and graphs
  • 48. CONTENT MANAGEMENTsync RPM content from CDNsync RPM content from other repositoriessync puppet content from Puppet Forgeseparate content into environments and content viewspromote contentconsume content using yum or puppetremote install/upgrade content
  • 49. THERE IS FOREMAN
  • 50. PROVISIONINGregister installation treesprepare provisioning templatesprovision bare-metal/virtual systemsmaintain registry of all systems
  • 51. CONFIGURATION MANAGEMENTimport Puppet classes into Foreman databaseassign classes to hosts (existing or provisioned)assign parameters to classescollect info from Facter and Puppetcreate statistics and graphs
  • 52. KATELLO UI
  • 53. KATELLO UI
  • 54. KATELLO UI
  • 55. RED HAT PRODUCTSSubscription Asset Manager (SAM)CloudForms System Engine
  • 56. WHAT IS TORQUEBOX AND JRUBY
  • 57. JRUBYRuby 1.8/1.9 on JVMmature and stable projectJIT and AOTbidirectionalis in Fedora
  • 58. TORQUEBOXapplication platform for Ruby on Rails, Sinatra...runs atop of JBoss ASoffers services like messaging, scheduling, cachingallows use of clustering, load-ballancing and HAuses standards where possible
  • 59. WHY SHOULD WE CARE? why to port to JVM
  • 60. WHY SHOULD WE CARE? memory :-)
  • 61. WHY SHOULD WE CARE?performance (skipping for this talk)
  • 62. WHY SHOULD WE CARE?
  • 63. MEMORY IS THE ISSUEbefore that we need to cover threads
  • 64. MRI RUBY 1.8 green threads
  • 65. MRI RUBY 1.9native threads with GIL
  • 66. GLOBAL INTERPRETER LOCKany time one thread is running _Ruby_ codeno other thread can be running _Ruby_ code
  • 67. GLOBAL INTERPRETER LOCK
  • 68. GLOBAL INTERPRETER LOCKsignificant barrier to parallelismdoes _not_ limit I/O by the designbut many native rubygems also limits I/O
  • 69. STATE OF THREADING IN MRI RUBY not the best
  • 70. FORKING SERVERS IN MRI RUBYthreads are not the only options for web concurencyprocess forking can do the thing tooLinux is good in forkingunfortunately MRI Ruby cant leverage COW memory
  • 71. FORKING SERVERS IN MRI RUBYRuby Enterprise Edition solves this for 1.8Ruby 1.9 has many REE optimalizations (but not COW)Ruby 2.0 will finally deliver COW-friendly forking(bitmaps)
  • 72. STATE OF FORKING IN MRI RUBY not the best
  • 73. DEPLOYMENT OPTIONS WITH RUBYThe Ruby community has always insisted that performance is not an issue while constantly searching for higher performance web servers and application stacks. -- Greg Weber
  • 74. DEPLOYMENT OPTIONS WITH RUBYevented programming (reactor pattern) brings some parallelism
  • 75. DEPLOYMENT OPTIONS WITH RUBY forking - phusion passenger, unicorn evented - thin, goliath, vert.x threaded - mongrel, torquebox
  • 76. DEPLOYMENT OPTIONS WITH RUBY combination of forking + evented combination of threaded + evented combination of threaded + forking
  • 77. DEPLOYMENT OPTIONS WITH RUBYthe issue with evented servers (thin) is granularity
  • 78. DEPLOYMENT OPTIONS WITH RUBY controller - sql* - render - response* controller - sql* - render - response* controller - sql* - render - response*
  • 79. DEPLOYMENT OPTIONS WITH RUBYto unleash power of evented processing, you need to rewrite your application (fibers, goliath, node.js, vert.x, async sinatra)
  • 80. DEPLOYMENT OPTIONS WITH RUBYthere are not many options for threading setups
  • 81. SO WHEN TO CONSIDER JRUBY?you have an app that is not build around evented patternyour app takes decent amount of memoryyour app also contains lots of I/O operations (SQL,messaging, REST calls)you want to scale up
  • 82. WARNINGI did not cover Rubinius or REE which partially solves some of these issues
  • 83. BY THE WAYthe following languages have concurrency built in the runtime erlang haskell google go
  • 84. AND WHATS JAVA
  • 85. BEFORE YOU START
  • 86. TRY WITH JRUBY FIRST instead of torquebox
  • 87. SLOW STARTjruby start a little bit slower
  • 88. OPTIMIZE JRUBY START#JV_PS"cin -juycmiemd=F" AAOT=-let Drb.opl.oeOFbnl ee rissreude xc al evr
  • 89. OPTIMIZE JRUBY START#JUYOT=-19--X+MCasnodnEald RB_PS"-. JX:CSlsUlaignbe--X+sCnMrSepCJX:UeocakweG--XMxemie26 --m10m JX:aPrSz=5m JXx80"bnl ee rissreude xc al evr
  • 90. OPTIMIZE JRUBY START#juy-n-evr& rb -gsre#bnl ee rissre ude xc al evr
  • 91. KATELLO START IN DEV$tm bnl ee rk evrnet ie ude xc ae niomnra 01.7sel m986ue 01.4ssr m824ss0074y m.6s
  • 92. KATELLO START IN PROD$tm rk evrnet ie ae niomnra 01.2sel m332ue 0999sr m.7sss0287y m.1s
  • 93. RUBYGEMS ARE SLOWmultiple directories approachruby needs to walk the treemany stat/open calls with ENOENTbundler adds more dirsrvm/rbenv adds even more dirs
  • 94. HOW RUBY HANDLES REQUIRE#src rk evrnet2& |ge EON tae ae niomn >1 rp NET...oe(xla_lf-../i/igeo.b,OROL)=- EONpn"/dpfuf013lbsnltnr" _DNY 1 NEToe(xntla-../i/igeo.b,OROL)=- EONpn"/e-dp031lbsnltnr" _DNY 1 NEToe(xjhnr-../i/igeo.b,OROL)=- EONpn"/sitb021lbsnltnr" _DNY 1 NEToe(xj-ots062lbsnltnr" OROL)=- EONpn"/srue-../i/igeo.b, _DNY 1 NEToe(xjmi-../i/igeo.b,OROL)=- EONpn"/amt065lbsnltnr" _DNY 1 NEToe(xyicmrso-../i/igeo.b,OROL)=- EONpn"/u-opesr096lbsnltnr" _DNY 1 NEToe(xi8_aa033lbsnltnr" OROL)=- EONpn"/1ndt-../i/igeo.b, _DNY 1 NET...
  • 95. HOW RUBY HANDLES REQUIRE O(n^2)
  • 96. HOW RUBY HANDLES REQUIRE optimized in ruby 2.0
  • 97. HOW RUBY 2.0 HANDLES REQUIRE O(n^2) - k
  • 98. HOW RUBY HANDLES REQUIRE enough theory!
  • 99. RUBYGEMS IN KATELLO#bnl isal|w - ude ntl c l102
  • 100. KATELLO STAT/OPEN MISSES IN PROD#src bnl ee rk evrnet2& |ge EON |w - tae ude xc ae niomn >1 rp NET c l4203
  • 101. KATELLO STAT/OPEN MISSES IN DEV#src bnl ee rk evrnet2& |ge EON |w - tae ude xc ae niomn >1 rp NET c l124732
  • 102. KATELLO STAT/OPEN MISSES IN DEV
  • 103. RUBYGEMS ARE SLOWand its not getting better
  • 104. RUBYGEMS ARE SLOW avoid bundler avoid rvm/rbenv use bundler_ext
  • 105. PORTING ISSUES
  • 106. BINARY FILESwriting to a binary file needs b-flag
  • 107. BINARY FILESFl.pn"hfl.i" b)d ||ieoe(teiebn, w o f fwiesuf .rt(tf)edn
  • 108. ACTIVERECORDinstall proper gems
  • 109. ACTIVERECORDi dfnd JUYVRIN f eie? RB_ESO gmcieeodjb-dpe e atvrcr-dcaatr gmdcpsge e jb-otrs, gmcieeodjbpsgeq-dpe e atvrcr-dcotrslaatr,es le gmg e ped n
  • 110. ACTIVERECORDvarious versions (rails 3.0 vs new adapter)
  • 111. ACTIVERECORDERRudfndmto `olcfr"rae_tDS"Srn (oehdRO neie ehd clet o cetda EC:tig NMtoErrro)..atvrcr-dcaatr126lbajb/otrslaatrr:2./cieeodjb-dpe-../i/rdcpsgeq/dpe.b60i `itnt:n dsic...
  • 112. OTHER ISSUESimproper rails namespace:-)
  • 113. RUBY AND SYSTEMTAP
  • 114. WHAT IS SYSTEMTAPfree software infrastructure to simplify the gathering of information about the running Linux system
  • 115. WHY SYSTEMTAP IS USEFUL no need to modify your app no need to restart it
  • 116. WHY SYSTEMTAP IS USEFUL steep learning curve C-like syntax
  • 117. WHY SYSTEMTAP IS USEFULvery low-levelsupports high-level (JVM, Python, Ruby)
  • 118. WHY SYSTEMTAP IS USEFULpart of RHEL and Fedorakernels are systemtap readyRuby extension part of RHEL 6.2 (RHSA-2011-1581)
  • 119. WHY SYSTEMTAP IS USEFUL project documentation and wiki RHEL6 SystemTap Beginners Guide
  • 120. INSTALL SYSTEMTAP#ym- isal u y ntlssetpytmassetprnieytma-utmkre-euif-uae-`enldbgno`nm rkre-euif-omn`nm -``nm -`enldbgnocmo-uae i-uae rkre-ee-uae-`enldvl`nm r
  • 121. UC1: HUNTING FILE CHANGE#tuh/et oc ts
  • 122. UC1: HUNTING FILE CHANGE#l - /et s i ts247
  • 123. UC1: HUNTING FILE CHANGE#l /e/d0 l dvm-bwr--.1ro ds 23 0Ar1 1:3/e/m0r-w-- ot ik 5, p 7 02 dvd-
  • 124. UC1: HUNTING FILE CHANGE#ctflcag.t a iehnespgoa AT_OE=1lbl TRMDpoekre.ucin"eat_oy),rb enlfnto(sttrcp"! kre.ucin"eei_eat"! enlfnto(gnrcsttr), kre.ucin"nd_eat" { enlfnto(ioesttr) dvn =$nd-is-sdv e_r ioe>_b>_e ioen =$nd-iio nd_r ioe>_n i (e_r= MDV$,2 #mjrmnrdvc f dvn = KE(1$) ao/io eie & ioen = $ & nd_r = 3 & $tr>avld&AT_OE & at-i_ai TRMD) pit (% %(d % 0%/u% %" rnf "d s%) s xx% o dn, gtiefa_s) eenm(,pd) poeuc) etmodyu(, xcae) i(, rbfn(, dvn,ioen,$tr>amd,ud) e_r nd_r at-i_oe i()}
  • 125. UC1: HUNTING FILE CHANGE#sa - flcag.t 23024& tp v iehnesp 5 7#cmd60/et ho 0 ts13662012 cmd65)gnrcsttr0f00024100 034792123 ho(17 eei_eat xd00/7 060
  • 126. UC2: DOWN THE RUBY STACK#ctfcoilr a atra.bdffcoilne atra f=1 frii 1.;f* i ed f ; o n .n = ; n;ednpt fcoil4us atra 2
  • 127. UC2: DOWN THE RUBY STACK#ctclssp a al.tpoerb.ucinety rb uyfnto.nr{ pit(% = %.si %:dn,tra_net1, rnf"s > s% n s%" hedidn() casae mtonm,fl,ln) lsnm, ehdae ie ie;}poerb.ucinrtr rb uyfnto.eun{ pit(% < %.si %:dn,tra_net-) rnf"s = s% n s%" hedidn(1, casae mtonm,fl,ln) lsnm, ehdae ie ie;}
  • 128. UC2: DOWN THE RUBY STACK#sa clssp- "uyfcoilr" tp al.t c rb atra.b1006172788412024159334000045017589953466451696800000 0rb(66) = Mdl.ehdaddi fcoilr: uy110: > ouemto_de n atra.b1 1 rb(66) < Mdl.ehdaddi fcoilr: 3 uy110: = ouemto_de n atra.b1 0rb(66) = Ojc.atra i fcoilr: uy110: > betfcoil n atra.b5 2 rb(66) = Rneec i fcoilr: 5 uy110: > ag.ah n atra.b2 6 rb(66) 1 uy110: = Fxu. i fcoilr: > inm* n atra.b2 .. . 75rb(66) 0 uy110: < Bgu. i fcoilr: = inm* n atra.b2 72rb(66) < Rneec i fcoilr: 1 uy110: = ag.ah n atra.b2 78rb(66) < Ojc.atra i fcoilr: 1 uy110: = betfcoil n atra.b2 0rb(66) = Ojc.usi fcoilr: uy110: > betpt n atra.b5 2 rb(66) = Bgu.osi fcoilr: 0 uy110: > inmt_ n atra.b5 3 rb(66) < Bgu.osi fcoilr: 8 uy110: = inmt_ n atra.b5 5 rb(66) = I.rt i fcoilr: 3 uy110: > Owie n atra.b5 7 rb(66) < I.rt i fcoilr: 4 uy110: = Owie n atra.b5 8 rb(66) = I.rt i fcoilr: 1 uy110: > Owie n atra.b5 9 rb(66) < I.rt i fcoilr: 9 uy110: = Owie n atra.b5 16rb(66) < Ojc.usi fcoilr: 0 uy110: = betpt n atra.b5
  • 129. UC2: DOWN THE RUBY STACK#ctrbcutsp a uyon.tgoa f_al; lbl nclspoerb.ucinety rb uyfnto.nr{ f_al[lsnm,mtonm]<<1 nclscasae ehdae < ;}poeed{rb n frah(casae mtonm]i f_al-lmt3){ oec [lsnm, ehdae n ncls ii 0 pit(%x%.sn, rnf"d s%" @on(nclscasae mtonm], cutf_al[lsnm, ehdae) casae mtonm) lsnm, ehdae; } dlt f_al; eee ncls}
  • 130. UC2: DOWN THE RUBY STACK#sa rbcutsp- "uyfcoilr" tp uyon.t c rb atra.b10061727884120241593340000 450175899534664516968000002xBgu. 1 inm*2xFxu. 1 inm*2 I.rt x Owie1 Mdl.ehdadd x ouemto_de1 Rneec x ag.ah1 Bgu.os x inmt_1 Ojc.us x betpt1 Ojc.atra x betfcoil
  • 131. UC3: RUBY "TOP"#ct.rb-o-oiidsp a /uytpmdfe.tgoa f_al[04] lbl ncls120;poerb.ucinety{ rb uyfnto.nr i (snt(ie "ael")f_al[i(, f iisrfl, ktlo) nclspd) fl,mtonm,ln]<<1 ie ehdae ie < ;}poetmrm(00 { rb ie.s40) as_la_cen) nicersre( pit(%s%0 %s%5 %sn, rnf"6 8s 6 2s 6" "I" "IEAE,"IE,"UCIN,"AL" PD, FLNM" LN" FNTO" CLS) frah(pdflnm,ucaelnn]i f_al-lmt1){ oec [i,ieaefnnm,ieo n ncls ii 5 pit(%d%0 %d%5 %dn, rnf"6 8s 6 2s 6" pd flnm,lnn,fnnm, i, ieae ieo ucae @on(nclspd flnm,fnnm,lnn]) cutf_al[i, ieae ucae ieo); } dlt f_al; eee ncls}
  • 132. BUNDLER_EXT
  • 133. BUNDLER_EXT http://rubygems.org/gems/bundler_exthttps://github.com/aeolus-incubator/bundler_ext
  • 134. BUNDLER_EXT#ctGmie a eflgmal ..0e ris, 301gmsne jogmetcin :eur = etcine rs-let, rqie > rs_letgmamt,=054e jmi > ..gmal_adn,=052e riswre > ..gme-dpe ntlagmate ouhgmdpfufe la_lf
  • 135. BUNDLER_EXTi Fl.xs?Fl.xadpt(./.Gmiei _FL_) f ieeit(ieepn_ah../efl.n, _IE_) rqieude_x eur bnlret Bnlrx.ytmrqieFl.xadpt(./.Gmiei _FL udeEtsse_eur(ieepn_ah../efl.n, _IE_) :ru1 :ru2 Risev _, gop, gop, al.n)es le Bnlrrqie:ru1 :ru2 Risev ude.eur gop, gop, al.ned n
  • 136. WE ARE DONE
  • 137. CREDITSGreg Weber - http://blog.gregweber.info/posts/2011-06-16-high-performance-rb-part3Ilya Grigorik -http://www.igvita.com/2008/11/13/concurrency-is-a-myth-in-ruby/inc.com - finish line picand world-famouse memegenerator.net