Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PyCon2014China-Zhuhai-high performance
Search
Zoom.Quiet
November 17, 2014
Technology
0
130
PyCon2014China-Zhuhai-high performance
141115 in Zhuhai
http://zoomq.qiniudn.com/CPyUG/PyCon2014China/141115zh-pm6-pyhq.MP3
Zoom.Quiet
November 17, 2014
Tweet
Share
More Decks by Zoom.Quiet
See All by Zoom.Quiet
PyCon2014China-Zhuhai-meta programming
zoomquiet
1
97
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
75
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
82
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
58
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
72
PyCon2014China-Zhuhai-jeff
zoomquiet
0
53
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
81
DevFest2014-Zhuhai-Polymer
zoomquiet
0
350
TEDxJLUZH MOMENT future
zoomquiet
0
320
Other Decks in Technology
See All in Technology
インシデント対応の 実践と品質文化の醸成
____rina____
1
200
안드로이드 기술 이력서의 최소 조건
pluu
1
1.2k
サーバーレス SaaS における運用監視の負荷軽減のためのアプローチ
ririru0325
0
100
次は君だ。~Japan AWS Jr. Champions 受賞までの奇跡~
fukuchiiinu
0
190
新入社員 オンボーディング改善プロジェクト - シンプルな仕組みで変革のきっかけを
enpipi
0
520
APIs for AI: Have we failed?
zdne
0
140
Covariance, Contravariance & Diamond
alexdaubois
1
120
GPSデバイスを使った簡易位置案内システムの構築をしてみた話。/jawsfesta2024
kwada
0
240
MOSH_companydeck_202410
mosh_inc
0
120
外部カンファレンスで登壇しよう! 〜「強い」エンジニアへの一歩を踏み出す〜
logica0419
4
140
Publication dès la conception : restitution et perspectives - MENJ / Code Lutin
bluehats
0
170
Microsoft 365 でデータセキュリティを強化しよう
sophiakunii
2
490
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
39
2.4k
Statistics for Hackers
jakevdp
796
220k
Optimising Largest Contentful Paint
csswizardry
31
2.9k
Building Your Own Lightsaber
phodgson
102
6k
It's Worth the Effort
3n
183
27k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Embracing the Ebb and Flow
colly
84
4.4k
Building an army of robots
kneath
302
42k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
130k
Adopting Sorbet at Scale
ufuk
73
9k
Transcript
Python是否适合高性能web开发 温铭
高性能服务端的要素 • 多:高并发,支撑用户多 • 快:单个请求处理速度快 • 易:易开发,易维护,方便调岗和招人
技术实现 • 高并发:异步 • 处理快:缓存,减少IO • 易开发:库,只用关心逻辑
通用的架构 • Nginx -> py -> memcached(redis) -> mysql •
同步 • 跨服务器请求
理想的架构 • 异步、同步语法 • 多级缓存:进程、本机kv、跨服务器kv、 DB • 没有网络IO
现实:异步 • Tornado:第三方库齐全,回调 • Gevent:不改代码 • Asyncio New in python
3.4
现实:缓存 • functools.lru_cache New in version 3.2
Python的优势 • 丰富的库 • 开发快 • 易上手
嫁接 • Python + ?
嫁接 • Openresty:替换nginx,提供异步和共享缓 存 • Nginx -> py -> memcached(redis)
-> mysql • openresty-> py -> cache(openresty ) -> kv(openresty ) -> mysql(openresty )
自己写服务端? • 用户注册、登录 • 短信通知 • 消息推动 • 聊天 •
存储 • 支付 • …
不用写服务端 • Parse • LeanCloud(AVOS)
Q&A