SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
INTERNSHIP FINAL REPORT
Who are you?
Ritta Narita
(github:@naritta)
The University of Tokyo, Engineering M2	

Researched about Physic simulation
I’ve worked in some companies.	

2
Projects for Intern
hivemall: Original VM for Random Forests	

!
ïŹ‚uentd: Socket Manager with ServerEngine
3
hivemall: Original VM for Random Forests
4
What’s Random Forest ?
make many decision trees,	

accept a majority decision
decision tree(play golf or not)
to know the result of decision tree,	

need calculation for bound features.
humidity	

> 30 %?
whether 	

= sunny
wind speed 	

> 10 m/s ?
play golf
don’t play
don’t play
don’t play
yes
yes
yes
5
generate JS code	

→execute using eval	

!
At present, to calculate decision tree
if (x[0]==0){	

	

 if (x[1]>30){	

	

 	

 return 1;}	

	

 	

 ・・・	

}	

else {	

	

 return 1;	

}
x = [weather, humidity, wind]	

0=play golf, 1=don’t play
humidity	

> 30 %?
whether 	

= sunny
wind speed 	

> 10 m/s ?
play golf
don’t play
don’t play
don’t play
yes
yes
yes
6
!
!
due to using eval, can execute any code	

!
For example	

hostile JS code like inïŹnite loop	

→burden for TD	

!
It’s difïŹcult to restrict JS code	

→need restricted environment to calculate decision tree	

!
Problem for JS
7
Then
generate original op code from tree model	

→execute on originalVM
PUT x[1]	

PUT 0	

IFEQ 10	

!
・	

・	

・
x = [weather, humidity, wind]	

0=play golf, 1=don’t play
if (x[0]==0){	

	

 if (x[1]>30){	

	

 	

 return 1;}	

	

 	

 ・・・	

}	

else {	

	

 return 1;	

}
8
What’s the merit?
・can ïŹnd illegal code like inïŹnite loop easily	

・only for comparator, so very restricted	

・less op code, very fast
9
My work
op code featured for comparator	

 only PUSH, POP, GOTO, IF~	

!
can ïŹnd inïŹnite loop	

In this code, supposed not to have loop	

→don’t execute same code
10
hadoop version 2.6, Hive 1.2.0 (Tez 0.6.1)	

!
hadoop cluster size: c3.2xlarge 8 nodes	

!
!
randomforest	

!
 number of test examples in test_rf: 18083	

!
 number of trees: 500	

!
!
!
compile num: 500	

!
eval num: 500 * 18083	

!
Javascript : 1062.04 s
(Nashorn)	

!
VM: 106.84 s  
comparison with JS
10 times faster
11
Why don’t you use Java bytecode and ASM ?
12
Because of the number of class loading
for example, if every clients make 500 models
	

↓	

too many class loading
If using one class and 500 method, 	

It is same.
13
summary
・very restricted, can ïŹnd illegal code	

!
・10 times faster	

!
・future prospects:	

	

 can make it even faster by binary code	

!
・merged in development branch	

	

 and will be released in v0.4	

14
ïŹ‚uentd: Socket Manager with ServerEngine
15
In ïŹ‚uentd v0.14
produce	

!
New multiprocess model
16
multiprocess at present
use in_multiprocess plugin	

have to use multi sockets and assign each ports by user
super	

visor
worker
worker
worker
port:	

24224
port:	

24226
port:	

24225
17
multiprocess v0.14
super	

visor
worker
worker
worker
port:	

24224
using Socket Manager, share one listening socket	

→can use multicore without any assignment
port:	

24224
port:	

24224
port:	

24224
Socket	

Manager	

server
Socket	

Manager	

client
Socket	

Manager	

client
Socket	

Manager	

client
18
in Windows
20
can use multicore power fully without unconsciousness	

setting ïŹle will get very simple 21
with SocketManagerwith in_multiprocess plugin
<source>	

type multiprocess	

<process>	

cmdline -c /etc/td-agent/td-agent-child1.conf	

</process>	

<process>	

cmdline -c /etc/td-agent/td-agent-child2.conf	

</process>	

</source>	

!
#/etc/td-agent/td-agent-child1.conf	

<source>	

type forward	

port 24224	

</source>	

!
#/etc/td-agent/td-agent-child2.conf	

<source>	

type forward	

port 24225	

</source>
<source>	

type forward	

port 24224	

</source>
setting when using 2 core
To implement Socket Manager, I used ServerEngine
worker
worker
worker
super	

visor
Server	

Engine
live restart
Heartbeat via pipe	

auto restart
22
ServerEngine is: a framework to implement 	

robust multiprocess servers like Unicorn.
Implementation (Unix)
②Unix Domain Socket (send_io ïŹle descriptor)
worker
worker
worker
Socket	

Manager	

client
Socket	

Manager	

client
Socket	

Manager	

client
FD
Spawn
Socket	

Manager	

server
super	

visor
Server	

Engine
①DRb (request listening socket)
24
Unix: very simple	

Windows: a little complex
main difference
1. can’t share socket by FD	

  in Windows, socket descriptor ≠ ïŹle descriptor	

  It doesn’t make sense to share FD	

  (have to use Winsock2 API to share sockets)	

!
2. have to lock accept	

	

 in unix, don’t need consider thundering herd	

 but do in windows.	

 
25
Implementation (Windows)
DRb
create socket from port and bind	

(WSASocket)	

↓	

duplicate exclusive socket by pid	

(WSADuplicateSocket)	

↓	

get socket protocol (WSAProcolInfo)
worker
worker
worker
Socket	

Manager	

server
Socket	

Manager	

client
Socket	

Manager	

client
Socket	

Manager	

client
from WSAProcolInfo,	

make WSASocket	

↓	

handle into FD	

↓	

IO.for_fd(FD)	

send this IO to Cool.io	

super	

visor
Server	

Engine
26
accept mutex
worker
worker
get 	

mutex
detach	

release 	

mutex
attach 	

listening socket	

to cool.io loop
accept
mutex
read and send data	

to buffer/output
server socket
get 	

mutex
detach	

release 	

mutex
attach 	

listening socket	

to cool.io loop
accept
read and send data	

to buffer/output
deal with post processing	

in this process as it is
other process can listen 	

while this process is dealing with data
27
rotation in order	

by accept mutex
 ①2376→②3456→⑱2696→④3388	

→①2376→②3456→ 28
As a result of test, 	

Thundering herd doesn’t occur in windows.	

Tentatively I implemented roughly with mutex,	

but I want to use IOCP like livuv in the future.	

!
Patches are welcome from Windows specialist!
29
benchmark result (unix)
AWS ubuntu 14.04 m4.xlarge
RPS IO
conventional
model
6798.69 	

/sec
1361.07 	

kb/s
new model	

(4 workers)
13743.02	

/sec
2751.29 	

kb/s
in_http → out_forward
30
benchmark result (windows)
AWS Microsoft Windows Server 2012 R2 m4.xlarge
RPS IO
conventional
model
1834.01	

/sec
385.07	

kb/s
new model	

(4 workers)
3513.31	

/sec
737.66	

kb/s
in_http → out_forward
31
Future work
・Buffering in multiprocess	

・accept mutex based IOCP
etc
summary
・Implemented ïŹ‚uentd Socket Manager with ServerEngine,	

and will be faster without consciousness.	

!
・There is details in ServerEngine Issue, 	

 you can test my forked branch(ïŹ‚uentd and ServerEngine)	

 and I’ll send PR after this report.
32
That’s all,Thank you!
33
appendix
Why don’t you use Object serialization?
35
Because of memory problem
When Random forests model is big and many customers use it, 	

It is too much memory consumption
36
ServerEngine is:
To implement Socket Manager, I used ServerEngine
a framework to implement 	

robust multiprocess servers like Unicorn.
37
how to use Socket Manager in ïŹ‚uentd side
!
#get socket manager	

socket_manager = ServerEngine::SocketManager.new_socket_manager 	

!
#get FD from socket manager	

fd = socket_manager.get_tcp(bind, port)	

!
#create listening socket from FD	

lsock = TCPServer.for_fd(fd.to_i)	

it doesn’t need consider about socket sharing in ïŹ‚uentd side,	

ServerEngine deal with it inside.
38
Benchmark Result
I’ll add multiprocess buffering function,	

After that I’ll do benchmark formally.	

!
Tentatively Show the rough result
40

Weitere Àhnliche Inhalte

Was ist angesagt?

Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellN Masahiro
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Treasure Data, Inc.
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guideN Masahiro
 
[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuitNAVER D2
 
ImplementaçÔes paralelas
ImplementaçÔes paralelasImplementaçÔes paralelas
ImplementaçÔes paralelasWillian Molinari
 
nginx: writing your first module
nginx: writing your first modulenginx: writing your first module
nginx: writing your first moduleredivy
 
Ansible module development 101
Ansible module development 101Ansible module development 101
Ansible module development 101yfauser
 
Implement server push in flask framework
Implement server push in flask frameworkImplement server push in flask framework
Implement server push in flask frameworkChi-Chia Huang
 
Bucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductionBucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductiondshkolnikov
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsjacekbecela
 
Gude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerGude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerApache Traffic Server
 
PyCon HK 2015 - Monitoring the performance of python web applications
PyCon HK 2015 -  Monitoring the performance of python web applicationsPyCon HK 2015 -  Monitoring the performance of python web applications
PyCon HK 2015 - Monitoring the performance of python web applicationsGraham Dumpleton
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Test driven infrastructure
Test driven infrastructureTest driven infrastructure
Test driven infrastructureSkills Matter Talks
 
Node js presentation
Node js presentationNode js presentation
Node js presentationmartincabrera
 
OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013databus.pro
 

Was ist angesagt? (20)

Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
 
Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14Keynote - Fluentd meetup v14
Keynote - Fluentd meetup v14
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
Fluentd v0.12 master guide
Fluentd v0.12 master guideFluentd v0.12 master guide
Fluentd v0.12 master guide
 
[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit[231] the simplicity of cluster apps with circuit
[231] the simplicity of cluster apps with circuit
 
ImplementaçÔes paralelas
ImplementaçÔes paralelasImplementaçÔes paralelas
ImplementaçÔes paralelas
 
nginx: writing your first module
nginx: writing your first modulenginx: writing your first module
nginx: writing your first module
 
Ansible module development 101
Ansible module development 101Ansible module development 101
Ansible module development 101
 
Implement server push in flask framework
Implement server push in flask frameworkImplement server push in flask framework
Implement server push in flask framework
 
Bucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductionBucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introduction
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Gude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerGude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic Server
 
PyCon HK 2015 - Monitoring the performance of python web applications
PyCon HK 2015 -  Monitoring the performance of python web applicationsPyCon HK 2015 -  Monitoring the performance of python web applications
PyCon HK 2015 - Monitoring the performance of python web applications
 
NodeJs
NodeJsNodeJs
NodeJs
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Test driven infrastructure
Test driven infrastructureTest driven infrastructure
Test driven infrastructure
 
Python, do you even async?
Python, do you even async?Python, do you even async?
Python, do you even async?
 
Node js presentation
Node js presentationNode js presentation
Node js presentation
 
OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013OpenNebula and SaltStack - OpenNebulaConf 2013
OpenNebula and SaltStack - OpenNebulaConf 2013
 
Fluentd v1 and Roadmap
Fluentd v1 and RoadmapFluentd v1 and Roadmap
Fluentd v1 and Roadmap
 

Andere mochten auch

Treasure Data Summer Internship Final Report
Treasure Data Summer Internship Final ReportTreasure Data Summer Internship Final Report
Treasure Data Summer Internship Final ReportNaoki Ishikawa
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Ryuichi ITO
 
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†Makoto Yui
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderSadayuki Furuhashi
 
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™ș
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™șP2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™ș
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™șshiftky
 
ICALP 2014 ć‚ćŠ èš˜
ICALP 2014 ć‚ćŠ èš˜ICALP 2014 ć‚ćŠ èš˜
ICALP 2014 ć‚ćŠ èš˜irrrrr
 
Testing Forest-Isomorphism in the Adjacency List Model
Testing Forest-Isomorphismin the Adjacency List ModelTesting Forest-Isomorphismin the Adjacency List Model
Testing Forest-Isomorphism in the Adjacency List Modelirrrrr
 
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·š
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·šăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·š
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·šKentaro Yoshida
 
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁ
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁçŹŹ2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁ
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁKenta Hattori
 
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07 EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07 Keizo Nagamine
 
20 cv mil_models_for_words
20 cv mil_models_for_words20 cv mil_models_for_words
20 cv mil_models_for_wordszukun
 
Mathematical approach for Text Mining 1
Mathematical approach for Text Mining 1Mathematical approach for Text Mining 1
Mathematical approach for Text Mining 1Kyunghoon Kim
 
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...Damiano Spina
 
Recommending Tags with a Model of Human Categorization
Recommending Tags with a Model of Human CategorizationRecommending Tags with a Model of Human Categorization
Recommending Tags with a Model of Human CategorizationChristoph Trattner
 
Latent Semantic Indexing and Search Engines Optimimization (SEO)
Latent Semantic Indexing and Search Engines Optimimization (SEO)Latent Semantic Indexing and Search Engines Optimimization (SEO)
Latent Semantic Indexing and Search Engines Optimimization (SEO)muzzy4friends
 
Analysis of Reviews on Sony Z3
Analysis of Reviews on Sony Z3Analysis of Reviews on Sony Z3
Analysis of Reviews on Sony Z3Krishna Bollojula
 
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)rchbeir
 
Geometric Aspects of LSA
Geometric Aspects of LSAGeometric Aspects of LSA
Geometric Aspects of LSAHeinrich Hartmann
 

Andere mochten auch (20)

Treasure Data Summer Internship Final Report
Treasure Data Summer Internship Final ReportTreasure Data Summer Internship Final Report
Treasure Data Summer Internship Final Report
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
 
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†
äžŠćˆ—ăƒ‡ăƒŒă‚żăƒ™ăƒŒă‚čă‚·ă‚čăƒ†ăƒ ăźæŠ‚ćż”ăšćŽŸç†
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™ș
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™șP2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™ș
P2PăƒăƒƒăƒˆăƒŻăƒŒă‚Żă‚’ćˆ©ç”šă—ăŸćˆ†æ•Łăƒ•ă‚Ąă‚€ăƒ«ă‚·ă‚čテムぼ開ç™ș
 
Fluentd meetup in japan
Fluentd meetup in japanFluentd meetup in japan
Fluentd meetup in japan
 
ICALP 2014 ć‚ćŠ èš˜
ICALP 2014 ć‚ćŠ èš˜ICALP 2014 ć‚ćŠ èš˜
ICALP 2014 ć‚ćŠ èš˜
 
Testing Forest-Isomorphism in the Adjacency List Model
Testing Forest-Isomorphismin the Adjacency List ModelTesting Forest-Isomorphismin the Adjacency List Model
Testing Forest-Isomorphism in the Adjacency List Model
 
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·š
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·šăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·š
ăƒˆăƒŹă‚žăƒŁăƒŒăƒ‡ăƒŒă‚ż ć°Žć…„äœ“éš“èš˜ ăƒȘăƒ–ă‚»ăƒłă‚čç·š
 
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁ
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁçŹŹ2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁ
珏2ç« ă‚ąăƒŒă‚­ăƒ†ă‚ŻăƒăƒŁ
 
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07 EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07
EventSystemăŸă‚ă‚Šăźè©±@UnityFukuoka07
 
tmu_science_cafe02
tmu_science_cafe02tmu_science_cafe02
tmu_science_cafe02
 
20 cv mil_models_for_words
20 cv mil_models_for_words20 cv mil_models_for_words
20 cv mil_models_for_words
 
Mathematical approach for Text Mining 1
Mathematical approach for Text Mining 1Mathematical approach for Text Mining 1
Mathematical approach for Text Mining 1
 
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...
SpeakerLDA: Discovering Topics in Transcribed Multi-Speaker Audio Contents @ ...
 
Recommending Tags with a Model of Human Categorization
Recommending Tags with a Model of Human CategorizationRecommending Tags with a Model of Human Categorization
Recommending Tags with a Model of Human Categorization
 
Latent Semantic Indexing and Search Engines Optimimization (SEO)
Latent Semantic Indexing and Search Engines Optimimization (SEO)Latent Semantic Indexing and Search Engines Optimimization (SEO)
Latent Semantic Indexing and Search Engines Optimimization (SEO)
 
Analysis of Reviews on Sony Z3
Analysis of Reviews on Sony Z3Analysis of Reviews on Sony Z3
Analysis of Reviews on Sony Z3
 
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)
LSI latent (par HATOUM Saria et DONGO ESCALANTE Irvin Franco)
 
Geometric Aspects of LSA
Geometric Aspects of LSAGeometric Aspects of LSA
Geometric Aspects of LSA
 

Ähnlich wie Treasure Data Summer Internship Final Report

Advanced off heap ipc
Advanced off heap ipcAdvanced off heap ipc
Advanced off heap ipcPeter Lawrey
 
NodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin WayNodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin WayEdureka!
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up Craig Schumann
 
Objects? No thanks!
Objects? No thanks!Objects? No thanks!
Objects? No thanks!corehard_by
 
Distributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayDistributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayodnoklassniki.ru
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on AndroidTetsuyuki Kobayashi
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in styleDefconRussia
 
Better Code: Concurrency
Better Code: ConcurrencyBetter Code: Concurrency
Better Code: ConcurrencyPlatonov Sergey
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"LogeekNightUkraine
 
44 con slides
44 con slides44 con slides
44 con slidesgeeksec80
 
44 con slides (1)
44 con slides (1)44 con slides (1)
44 con slides (1)geeksec80
 
Multi-core Node.pdf
Multi-core Node.pdfMulti-core Node.pdf
Multi-core Node.pdfAhmed Hassan
 
Scalable Socket Server by Aryo
Scalable Socket Server by AryoScalable Socket Server by Aryo
Scalable Socket Server by AryoAgate Studio
 
How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageablecorehard_by
 
StudioSL Presentation in Grenoble 2011
StudioSL Presentation in Grenoble 2011StudioSL Presentation in Grenoble 2011
StudioSL Presentation in Grenoble 2011Enrico Scantamburlo
 
Virtualization and Socket Programing
Virtualization and Socket ProgramingVirtualization and Socket Programing
Virtualization and Socket ProgramingMidhun S
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJSYura Bogdanov
 

Ähnlich wie Treasure Data Summer Internship Final Report (20)

Advanced off heap ipc
Advanced off heap ipcAdvanced off heap ipc
Advanced off heap ipc
 
NodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin WayNodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin Way
 
BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up BP206 - Let's Give Your LotusScript a Tune-Up
BP206 - Let's Give Your LotusScript a Tune-Up
 
Objects? No thanks!
Objects? No thanks!Objects? No thanks!
Objects? No thanks!
 
Distributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevdayDistributed systems at ok.ru #rigadevday
Distributed systems at ok.ru #rigadevday
 
Nodejs
NodejsNodejs
Nodejs
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on Android
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in style
 
Better Code: Concurrency
Better Code: ConcurrencyBetter Code: Concurrency
Better Code: Concurrency
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
Oleksandr Smoktal "Parallel Seismic Data Processing Using OpenMP"
 
44 con slides
44 con slides44 con slides
44 con slides
 
44 con slides (1)
44 con slides (1)44 con slides (1)
44 con slides (1)
 
Multi-core Node.pdf
Multi-core Node.pdfMulti-core Node.pdf
Multi-core Node.pdf
 
Scalable Socket Server by Aryo
Scalable Socket Server by AryoScalable Socket Server by Aryo
Scalable Socket Server by Aryo
 
How to make a large C++-code base manageable
How to make a large C++-code base manageableHow to make a large C++-code base manageable
How to make a large C++-code base manageable
 
StudioSL Presentation in Grenoble 2011
StudioSL Presentation in Grenoble 2011StudioSL Presentation in Grenoble 2011
StudioSL Presentation in Grenoble 2011
 
Virtualization and Socket Programing
Virtualization and Socket ProgramingVirtualization and Socket Programing
Virtualization and Socket Programing
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJS
 

KĂŒrzlich hochgeladen

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĂŁo Esperancinha
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

KĂŒrzlich hochgeladen (20)

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

Treasure Data Summer Internship Final Report

  • 2. Who are you? Ritta Narita (github:@naritta) The University of Tokyo, Engineering M2 Researched about Physic simulation I’ve worked in some companies. 2
  • 3. Projects for Intern hivemall: Original VM for Random Forests ! ïŹ‚uentd: Socket Manager with ServerEngine 3
  • 4. hivemall: Original VM for Random Forests 4
  • 5. What’s Random Forest ? make many decision trees, accept a majority decision decision tree(play golf or not) to know the result of decision tree, need calculation for bound features. humidity > 30 %? whether = sunny wind speed > 10 m/s ? play golf don’t play don’t play don’t play yes yes yes 5
  • 6. generate JS code →execute using eval ! At present, to calculate decision tree if (x[0]==0){ if (x[1]>30){ return 1;} ・・・ } else { return 1; } x = [weather, humidity, wind] 0=play golf, 1=don’t play humidity > 30 %? whether = sunny wind speed > 10 m/s ? play golf don’t play don’t play don’t play yes yes yes 6
  • 7. ! ! due to using eval, can execute any code ! For example hostile JS code like inïŹnite loop →burden for TD ! It’s difïŹcult to restrict JS code →need restricted environment to calculate decision tree ! Problem for JS 7
  • 8. Then generate original op code from tree model →execute on originalVM PUT x[1] PUT 0 IFEQ 10 ! ・ ・ ・ x = [weather, humidity, wind] 0=play golf, 1=don’t play if (x[0]==0){ if (x[1]>30){ return 1;} ・・・ } else { return 1; } 8
  • 9. What’s the merit? ・can ïŹnd illegal code like inïŹnite loop easily ・only for comparator, so very restricted ・less op code, very fast 9
  • 10. My work op code featured for comparator  only PUSH, POP, GOTO, IF~ ! can ïŹnd inïŹnite loop In this code, supposed not to have loop →don’t execute same code 10
  • 11. hadoop version 2.6, Hive 1.2.0 (Tez 0.6.1) ! hadoop cluster size: c3.2xlarge 8 nodes ! ! randomforest !  number of test examples in test_rf: 18083 !  number of trees: 500 ! ! ! compile num: 500 ! eval num: 500 * 18083 ! Javascript : 1062.04 s (Nashorn) ! VM: 106.84 s   comparison with JS 10 times faster 11
  • 12. Why don’t you use Java bytecode and ASM ? 12
  • 13. Because of the number of class loading for example, if every clients make 500 models
 ↓ too many class loading If using one class and 500 method, It is same. 13
  • 14. summary ・very restricted, can ïŹnd illegal code ! ・10 times faster ! ・future prospects: can make it even faster by binary code ! ・merged in development branch and will be released in v0.4 14
  • 15. ïŹ‚uentd: Socket Manager with ServerEngine 15
  • 16. In ïŹ‚uentd v0.14 produce ! New multiprocess model 16
  • 17. multiprocess at present use in_multiprocess plugin have to use multi sockets and assign each ports by user super visor worker worker worker port: 24224 port: 24226 port: 24225 17
  • 18. multiprocess v0.14 super visor worker worker worker port: 24224 using Socket Manager, share one listening socket →can use multicore without any assignment port: 24224 port: 24224 port: 24224 Socket Manager server Socket Manager client Socket Manager client Socket Manager client 18
  • 19.
  • 21. can use multicore power fully without unconsciousness setting ïŹle will get very simple 21 with SocketManagerwith in_multiprocess plugin <source> type multiprocess <process> cmdline -c /etc/td-agent/td-agent-child1.conf </process> <process> cmdline -c /etc/td-agent/td-agent-child2.conf </process> </source> ! #/etc/td-agent/td-agent-child1.conf <source> type forward port 24224 </source> ! #/etc/td-agent/td-agent-child2.conf <source> type forward port 24225 </source> <source> type forward port 24224 </source> setting when using 2 core
  • 22. To implement Socket Manager, I used ServerEngine worker worker worker super visor Server Engine live restart Heartbeat via pipe auto restart 22 ServerEngine is: a framework to implement robust multiprocess servers like Unicorn.
  • 23.
  • 24. Implementation (Unix) ②Unix Domain Socket (send_io ïŹle descriptor) worker worker worker Socket Manager client Socket Manager client Socket Manager client FD Spawn Socket Manager server super visor Server Engine ①DRb (request listening socket) 24
  • 25. Unix: very simple Windows: a little complex main difference 1. can’t share socket by FD   in Windows, socket descriptor ≠ ïŹle descriptor   It doesn’t make sense to share FD   (have to use Winsock2 API to share sockets) ! 2. have to lock accept in unix, don’t need consider thundering herd  but do in windows.   25
  • 26. Implementation (Windows) DRb create socket from port and bind (WSASocket) ↓ duplicate exclusive socket by pid (WSADuplicateSocket) ↓ get socket protocol (WSAProcolInfo) worker worker worker Socket Manager server Socket Manager client Socket Manager client Socket Manager client from WSAProcolInfo, make WSASocket ↓ handle into FD ↓ IO.for_fd(FD) send this IO to Cool.io super visor Server Engine 26
  • 27. accept mutex worker worker get mutex detach release mutex attach listening socket to cool.io loop accept mutex read and send data to buffer/output server socket get mutex detach release mutex attach listening socket to cool.io loop accept read and send data to buffer/output deal with post processing in this process as it is other process can listen while this process is dealing with data 27
  • 28. rotation in order by accept mutex  ①2376→②3456→⑱2696→④3388 →①2376→②3456→ 28
  • 29. As a result of test, Thundering herd doesn’t occur in windows. Tentatively I implemented roughly with mutex, but I want to use IOCP like livuv in the future. ! Patches are welcome from Windows specialist! 29
  • 30. benchmark result (unix) AWS ubuntu 14.04 m4.xlarge RPS IO conventional model 6798.69 /sec 1361.07 kb/s new model (4 workers) 13743.02 /sec 2751.29 kb/s in_http → out_forward 30
  • 31. benchmark result (windows) AWS Microsoft Windows Server 2012 R2 m4.xlarge RPS IO conventional model 1834.01 /sec 385.07 kb/s new model (4 workers) 3513.31 /sec 737.66 kb/s in_http → out_forward 31
  • 32. Future work ・Buffering in multiprocess ・accept mutex based IOCP
etc summary ・Implemented ïŹ‚uentd Socket Manager with ServerEngine, and will be faster without consciousness. ! ・There is details in ServerEngine Issue,  you can test my forked branch(ïŹ‚uentd and ServerEngine)  and I’ll send PR after this report. 32
  • 35. Why don’t you use Object serialization? 35
  • 36. Because of memory problem When Random forests model is big and many customers use it, It is too much memory consumption 36
  • 37. ServerEngine is: To implement Socket Manager, I used ServerEngine a framework to implement robust multiprocess servers like Unicorn. 37
  • 38. how to use Socket Manager in ïŹ‚uentd side ! #get socket manager socket_manager = ServerEngine::SocketManager.new_socket_manager ! #get FD from socket manager fd = socket_manager.get_tcp(bind, port) ! #create listening socket from FD lsock = TCPServer.for_fd(fd.to_i) it doesn’t need consider about socket sharing in ïŹ‚uentd side, ServerEngine deal with it inside. 38
  • 39.
  • 40. Benchmark Result I’ll add multiprocess buffering function, After that I’ll do benchmark formally. ! Tentatively Show the rough result 40