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-...
What is `lev` ?Lua for Event-based IOlibuv + LuaJIT  EventLoop           Lua, JIT Engine`lev` is platform/language that st...
Concepts of `lev`Fast !!`lev` can easily reach over 10,000 requests percore , machine and scales near-linearly.Low Memory ...
Who founded `lev` ?founder: @kristatecofounder: @hkanamur`lev` is everything great about Node,withoutthe "BS" of JS.― kris...
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...
`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...
Benchmark Enviroments                       100BASE-T                        Ethernet        Client        direct connect ...
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      375...
Benchmark      Results - Memory usage (output of ps)                startup  after ab -n 2000 -c 1 after ab -n 2000 -c 10a...
ImplementationWe overhauled luvit, andreimplementation cBuffer MessagePack Build-in multicore Redesigned API Modules Build...
cBufferBuffer module                 lev_slab_allocator_t mem_1k;                lev_slab_allocator_t mem_8k;             ...
MessagePack   lua-msgpack-native                          (*1)       author: @kengonakajima       full scratch       C imp...
Build-in multicoreDefault build-inSpecify number of core at start up$ lev -c 8 ./examples/http-simple-server.luaMaster-Wor...
Redesigned APIEx: fs  synclocal fs = require(lev).fslocal err, fd = fs.open(LICENSE.txt, r, 0666)...  asynclocal fs = requ...
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 libraryResolv...
Conclusion`lev` is platform/language that start upa server more easily than Node  Fast  Low memory  Easy C-libraries integ...
Special Thanks !!@kristate, @hnakamurlev communityluvit team and luvit commuityMike Pall (LuaJIT)@kengonakajima (lua-msgpa...
Thank youfor listening to my       session         28
Question ?    29
Referenceluvit  http://luvit.io/  https://github.com/creationix/  nodeconf2012  http://coderwall.com/p/gkokawbenchmark dat...
Upcoming SlideShare
Loading in …5
×

Lev

4,425 views

Published on

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

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

No Downloads
Views
Total views
4,425
On SlideShare
0
From Embeds
0
Number of Embeds
1,205
Actions
Shares
0
Downloads
8
Comments
0
Likes
4
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
  • Lev

    1. 1. levTokyo Node Gakuen 7 periods 2012/09/18 @kazupon (kazu_pon) 1
    2. 2. Introduction@kazuponname: kazuya kawaguchitwitter: kazu_ponJobOKI -> Bluebridge -> Freelance (now)Flont-end Engneer? Back-end Engneer?WorkZenback, and others ...Nodeconnect-kyotokyotocabinet-nodeSabaDB 2
    3. 3. 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
    4. 4. 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
    5. 5. Who founded `lev` ?founder: @kristatecofounder: @hkanamur`lev` is everything great about Node,withoutthe "BS" of JS.― kristopher tate, lev founder @kristate @hnakamur 5
    6. 6. Video message from @kristatehttp://www.ustream.tv/recorded/25501929 21:25-25:10 6
    7. 7. `lev` Fork from luvit, overhaul, reimplementation $ git diff --shortstat 173c91...masterhttps://github.com/connectFree/lev/compare/173c91e383361fb09c1e7f973f6e24bec0d4fcec...master 7
    8. 8. `lev`connectFree open sourceApache 2.0 license 8
    9. 9. Contributors@hnakamur @dvv @kristate @xming @kazupon 9
    10. 10. Communitygithubhttp://github.com/connectFree/levIRCfreenode: #levdev, #lev-jp 10
    11. 11. Demo chatbit.ly/levchat 11
    12. 12. BenchmarkMeasurement item Requests per second Memory usageMeasurement Pattern ab -n 2000 -c 1 ab -n 2000 -c 10 ab -n 2000 -c 100 12
    13. 13. 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
    14. 14. BenchmarkVersion Node: 0.8.9 luvit: 0.5.0 lev: b03a16d (git commit hash) 14
    15. 15. 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
    16. 16. 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
    17. 17. ImplementationWe overhauled luvit, andreimplementation cBuffer MessagePack Build-in multicore Redesigned API Modules Build system Platform 17
    18. 18. 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
    19. 19. 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
    20. 20. 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
    21. 21. 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
    22. 22. Moduleslev timerfs pipecallboxmpackjsondnstcpudphttp 22
    23. 23. Build systemMakefile build system base Future: cmake build system (by @xming)Not use GYP build system 23
    24. 24. Platform*NIX Linux, Darwin, Freebsd, and other ...Not support Windows 24
    25. 25. Loadmap (Wishlist)Build-in Web application frameworkBuild-in Package managment toolChoice regular expression libraryResolve callback hell... etc 25
    26. 26. 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
    27. 27. Special Thanks !!@kristate, @hnakamurlev communityluvit team and luvit commuityMike Pall (LuaJIT)@kengonakajima (lua-msgpack-native)libuv, Node conributers, and Joyent 27
    28. 28. Thank youfor listening to my session 28
    29. 29. Question ? 29
    30. 30. Referenceluvit http://luvit.io/ https://github.com/creationix/ nodeconf2012 http://coderwall.com/p/gkokawbenchmark data git://gist.github.com/3727820.git 30

    ×