Upload
tom-chen
View
895
Download
0
Embed Size (px)
Citation preview
( DevOps T.T)
20 !
http://www.inside.com.tw/2013/12/20/59-hilarious-but-true-programming-quotes-for-software-developers
orz
• Server•
• ID •
•
Server
: , : Server
, , ISP
- / ( ) / ...
: Server : HA (High Availability)
DRBD + Heartbeat Active-Passive HA
10.0.0.101 10.0.0.102
IP (VIP)10.0.0.100 IP
, (transparent)
* 101/102 IP
DRBD MySQL (samba)
...
: wifi or 4G : , Server/
MySQL Read-only Replica
server server
server, ,
server DRBD + heartbeat
serverRead-only replica
DB
Internet
LAN
ID
(Read/Write)?
: Primary (Active) Write, Secondary (Passive) Read
ID
Django Server(HTTP API Server)
• ( / JPG)•• ( / )• / / •• (Session)•Insnergy •Infographics
• Session, , • ( / RFID ) Session • Session • RFID • ,
serverRead-only replica
DBredis slave
server DRBD + heartbeat
django django-rest-framework
django django-rest-framework django-allauth (social)
only ( )django django-rest-framework
(read-only)
• Server•
• ID •
•
,
AP, 200+ , 10
AP Switch
Router!!!
10.0.0.X
10.0.1.XA/B ( / )
10.0.3.XC ( )
10.0.4.XD ( )
10.0.5.XE ( )
10.0.6.XF ( )
10.0.7.XG ( )
Lab Internal &
+
1 ( ) 2 ( )
x15
(A-G) X (EX2)
IP
ABCDEFG X
EX2 ( )
10.0.X.YX A-G , 1-7
Y , 101 EX2 IP 10.0.5.102
?
orz
DEMO!
• Server•
• ID •
•
ID
: Plug & Play & Portable
1. ( / ) 2. 3. IP ( DHCP),
QR code
Bad Practice: Server IP & Port zeroconf / avahi , subnet
zeroconf / avahi, ID ,
, ID
QR Code ,
ID
QR Code /
:
bug feature request ...
: Auto Update ID
(HTTP API call)
git fetchgit checkout version_tag
redis
ID redis 1. 2. 3.
ID
C2 C
magic packet
IP, heartbeat server
Django (Web Server)
Integration Test redis ID
ID
••• RFID• QR Code• Session ••
• Auto Update • / • Heartbeat••
• (redis / QR)• (QR)• (redis)
• Server•
• ID •
•
?
Server
1. OS: + x2 (ubuntu server)2. HA: DRBD + heartbeat, zfs3. DB: MySQL (replica)4. MQ: redis 5. DNS: Domain 6. Web Server : nginx / Let’s Encrypt / Security Check7. Web App: Python Environment / git / python code8. samba ( )9.
https://www.ssllabs.com/ssltest/
ProductionStagingDev
Development
http://www.webopedia.com/TERM/S/staging_server.html
server
1. dev code, git2. server git code3. transpile (webpack) Babel, JSX, minify etc.4. Django collect static5. reload nginx
ID : Auto Update
, Prototype Auto Update
Auto Update bug GG!!!
ID
1. dev code, git2. server ID machine version 3. ID
Auto Update Auto Update?
: Copy & Paste orz..
BT Sync (Now Resilio)
Server (HTTP API)
• Server•
• ID •
•
? XD
HTTPS
SSL HTTPS
: Wifi WEP
Wifi, (like: HTTPS)
QR code ?
hash checksum
command.reboot.d87a
QR Code?
10.0.0.X
10.0.1.XA ( )
10.0.3.XC ( )
10.0.4.XD ( )
10.0.5.XE ( )
10.0.6.XF ( )
10.0.7.XG ( )
Lab Internal &
+
1 ( ) 2 ( )
x15
+ : XSS / SQL Injection etc.
https://docs.djangoproject.com/ja/1.9/topics/security/
,
Trade-off
Server: , ,
: Server GG? Bottle neck Server
Server: , loosely coupled
: Bottle neck Server , Server
Subnet: ,
: , zeroconf / avahi
MySQL Replica HTTP API Call: , MySQL ,
: Django ,
ID unicast: , , Debug
:
Database ( ) code?DB : , , :
: source control , : ,
UDP TCP?UDP : , , : , TCP : , , : ,
90% , , 90%
(good practices)
, code ... ...
source control ...
coding… 50 ...
...
512 527 90% 501 511 525?
/ Google / Facebook / KKBox / m01( )
Chrome ? Blizzard Agent ?MOD ? KKBox ?
Thank youAny questions?
Scale
C10K problemhttp://www.kegel.com/c10k.html
( )
: — ( ) ( ) — ( ) ( ) — ( ) ( ) — ( )
Jack ( ) , , !
http://www.mobile01.com/topicdetail.php?f=507&t=1955864
Server ?
moment ?or ?
HTTP API Server request ?
request?300 , Server ?
Example: PyCon 2015 Bingo!
, Check
300 & Check: , 15
Cache
CPU I/O?
? scale?
Example: 101 25ms or 200ms
( HTTP request header overhead)
Performance Tuning
Sphinx