Slide 1

Slide 1 text

Y U K I TA K E I A b o u t D e p l o y i n g a n d P ro c e s s M a n a g e m e n t f o r S l i m a n e 2 0 1 6 J U N 2 7 T O K Y O S E R V E R S I D E S W I F T M E E T U P

Slide 2

Slide 2 text

Hello! I’m Yuki Takei

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

• 100% asynchronous(built over libuv) • Express(Node.js) inspired • Stand Alone HTTP Server • Moduler • Faster • Adopts Open-Swift • Supports Multiprocess Environment Slimane is a Web Framework/HTTP Server for Swift3

Slide 6

Slide 6 text

• Routing/Middleware • Session • JSON • Hash Functions • Redis • WebSocket • View/Template Engine • Promise • Future Available functionalities(Modules) And more…. https://github.com/slimane-swift

Slide 7

Slide 7 text

S w i f t y - L i b u v S U V S K E LT O N S L I M A N E Layer of Slimane OS App libuvͷSwiftόΠϯσΟϯά ඇಉظωοτϫʔΫϓϥοτϑΥʔϜ TCPɺUDPɺProcessɺ FIleSystemɺDNS etc… SuvϕʔεͷHTTPαʔόʔ HTTPϓϩτίϧͷύʔζ ΞϓϦέʔγϣϯϑϨʔϜϫʔΫ system callɺevent loop

Slide 8

Slide 8 text

Today I’ll show you a first step of deploying and process management for Slimane

Slide 9

Slide 9 text

Anyways

Slide 10

Slide 10 text

How do you deploy your application?

Slide 11

Slide 11 text

How do you restart your application?

Slide 12

Slide 12 text

• Blue Green Deployment • Cloud Services provided • Capistrano(with SCM) • Rsync There are some major deploying ways

Slide 13

Slide 13 text

Blue Green Deployment (Immutable infrastructure)

Slide 14

Slide 14 text

Blue Green Deployment (Immutable infrastructure) No Down Time!

Slide 15

Slide 15 text

Cloud Service Provided

Slide 16

Slide 16 text

Cloud Service Provided No Down Time!(Probably..)

Slide 17

Slide 17 text

Capistrano or rsync access distribute changes

Slide 18

Slide 18 text

Capistrano or rsync access distribute changes Have to restart

Slide 19

Slide 19 text

Capistrano or rsync access distribute changes Has Down Time!

Slide 20

Slide 20 text

There should not be down time on our services

Slide 21

Slide 21 text

So we have to choose Blue Green Deployment or Cloud services provided one?

Slide 22

Slide 22 text

We Should!

Slide 23

Slide 23 text

But.. wait

Slide 24

Slide 24 text

It’s not necessarily for all projects.

Slide 25

Slide 25 text

Should depends on the project size, money, people and phase

Slide 26

Slide 26 text

Well, what should we do?

Slide 27

Slide 27 text

Graceful Restart

Slide 28

Slide 28 text

access master process child processes(fork) distribute changes What is Graceful Restart?

Slide 29

Slide 29 text

access master process folk new children (old processes) kill gradually What is Graceful Restart?

Slide 30

Slide 30 text

access master process folk new children (old processes) kill gradually What is Graceful Restart?

Slide 31

Slide 31 text

access master process folk new children kill gradually No Down Time! What is Graceful Restart?

Slide 32

Slide 32 text

• Nginx • Apache • Unicorn(Rack HTTP Server) • PM2(Node.js) Major Servers/Tools that supports `Graceful Restart`

Slide 33

Slide 33 text

How about Slimane(Swift)?

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

• Use via Command line interface • Controllable by signals • Observing workers(like a supervisor) • Can take cpu/memory usage from each workers • Will merge to Skelton partially (it means Skelton’ll become like a Unicorn) PMS is a process manger for apps that are built over Skelton

Slide 36

Slide 36 text

(But super early…)

Slide 37

Slide 37 text

Demo

Slide 38

Slide 38 text

• USR2 (Gracefully restart all workers) • USR1 (Reopen log files) • TTIN (Increase a worker process) • TTOU (Decrease a worker process) • INT/TERM(exit immediately) Supported signals(2016-06-27)

Slide 39

Slide 39 text

Thanks!