• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Lev
 

Lev

on

  • 3,724 views

Lev

Lev
Tokyo Node Gakuen 7 periods
2012/09/18
@kazupon
(kazu_pon)

Statistics

Views

Total Views
3,724
Views on SlideShare
2,662
Embed Views
1,062

Actions

Likes
3
Downloads
6
Comments
0

7 Embeds 1,062

http://yosuke-furukawa.hatenablog.com 477
http://tech.nifty.co.jp 453
https://twitter.com 106
http://localhost 20
https://si0.twimg.com 3
http://webcache.googleusercontent.com 2
http://twitter.com 1
More...

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

Lev Lev Presentation Transcript

  • levTokyo Node Gakuen 7 periods 2012/09/18 @kazupon (kazu_pon) 1
  • Introduction@kazuponname: kazuya kawaguchitwitter: kazu_ponJobOKI -> Bluebridge -> Freelance (now)Flont-end Engneer? Back-end Engneer?WorkZenback, and others ...Nodeconnect-kyotokyotocabinet-nodeSabaDB 2
  • What is `lev` ?Lua for Event-based IOlibuv + LuaJIT EventLoop Lua, JIT Engine`lev` is platform/language that startup a server more easily than Node 3
  • Concepts of `lev`Fast !!`lev` can easily reach over 10,000 requests percore , machine and scales near-linearly.Low Memory !!At start-up, `lev` only allocates around 2MBand after benchmarking HTTP a little over 3MB.Easy C-libraries integration !!`lev` is based on lua which has a very simpleand compact C ABI. 4
  • Who founded `lev` ?founder: @kristatecofounder: @hkanamur`lev` is everything great about Node,withoutthe "BS" of JS.― kristopher tate, lev founder @kristate @hnakamur 5
  • Video message from @kristatehttp://www.ustream.tv/recorded/25501929 21:25-25:10 6
  • `lev` Fork from luvit, overhaul, reimplementation $ git diff --shortstat 173c91...masterhttps://github.com/connectFree/lev/compare/173c91e383361fb09c1e7f973f6e24bec0d4fcec...master 7
  • `lev`connectFree open sourceApache 2.0 license 8
  • Contributors@hnakamur @dvv @kristate @xming @kazupon 9
  • Communitygithubhttp://github.com/connectFree/levIRCfreenode: #levdev, #lev-jp 10
  • Demo chatbit.ly/levchat 11
  • BenchmarkMeasurement item Requests per second Memory usageMeasurement Pattern ab -n 2000 -c 1 ab -n 2000 -c 10 ab -n 2000 -c 100 12
  • Benchmark Enviroments 100BASE-T Ethernet Client direct connect ServerMacBook Pro Retina, Mid 2012 Macbook, Early 2009* CPU: 2.6 GHz Intel Core i7 * CPU: 2GHz Intel Core 2 Duo* RAM: 16GB 1600 MHz DDR3 * RAM: 4GB 667 MHz DDR2 SDRAM* Disk: 512GB * Disk: 256GB APPLE SSD SM512E FUJITSU MHZ2250BH FFS G1 Media* OS: Mac OS X 10.8 Mountain SATALion * OS: Mac OS X 10.7.3 Lion 13
  • BenchmarkVersion Node: 0.8.9 luvit: 0.5.0 lev: b03a16d (git commit hash) 14
  • Benchmark Results - Requests per second ab -n 2000 -c 1 ab -n 2000 -c 10ab -n 2000 -c 100 0 3750 7500 11250 15000 Node luvit lev 15
  • Benchmark Results - Memory usage (output of ps) startup after ab -n 2000 -c 1 after ab -n 2000 -c 10after ab -n 2000 -c 100 0 5 10 15 20 Node luvit lev 16
  • ImplementationWe overhauled luvit, andreimplementation cBuffer MessagePack Build-in multicore Redesigned API Modules Build system Platform 17
  • cBufferBuffer module lev_slab_allocator_t mem_1k; lev_slab_allocator_t mem_8k; MemBlock pool[]; MemBlock pool[];C bytes: 1024 bytes: 1024 ... x8implementation lev_slab_allocator_t mem_16k;Allocated MemBlock pool[]; bytes: 1024special slab ... x16allocator lev_slab_allocator_t mem_64k; lev_slab_allocator_t mem_1024k; MemBlock pool[]; MemBlock pool[];Byte array bytes: 1024 ... x64 bytes: 1024 ... x1024Seamless MemSliceconversion to char *slice; size_t until;string lev.Buffer 18
  • MessagePack lua-msgpack-native (*1) author: @kengonakajima full scratch C implementation 5x ~ 10x faster than mplua (*2) 20x ~ 50x faster than luvits JSON Customization for cBuffer build-in module*1 https://github.com/kengonakajima/lua-msgpack-native*2 https://github.com/nobu-k/mplua 19
  • Build-in multicoreDefault build-inSpecify number of core at start up$ lev -c 8 ./examples/http-simple-server.luaMaster-Worker process modelShared listening socketCommunication: IPCMessge format: MessagepackEvent notification: callbox 20
  • Redesigned APIEx: fs synclocal fs = require(lev).fslocal err, fd = fs.open(LICENSE.txt, r, 0666)... asynclocal fs = require(lev).fsfs.open(LICENSE.txt, r, 0666, function(err, fd) ...end) 21
  • Moduleslev timerfs pipecallboxmpackjsondnstcpudphttp 22
  • Build systemMakefile build system base Future: cmake build system (by @xming)Not use GYP build system 23
  • Platform*NIX Linux, Darwin, Freebsd, and other ...Not support Windows 24
  • Loadmap (Wishlist)Build-in Web application frameworkBuild-in Package managment toolChoice regular expression libraryResolve callback hell... etc 25
  • Conclusion`lev` is platform/language that start upa server more easily than Node Fast Low memory Easy C-libraries integrationOverhauled and redesigned cBuffer baseSupport multicore with build-in 26
  • Special Thanks !!@kristate, @hnakamurlev communityluvit team and luvit commuityMike Pall (LuaJIT)@kengonakajima (lua-msgpack-native)libuv, Node conributers, and Joyent 27
  • Thank youfor listening to my session 28
  • Question ? 29
  • Referenceluvit http://luvit.io/ https://github.com/creationix/ nodeconf2012 http://coderwall.com/p/gkokawbenchmark data git://gist.github.com/3727820.git 30