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
150
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
120
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
95
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
88
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
81
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
94
PyCon2014China-Zhuhai-jeff
zoomquiet
0
73
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
100
DevFest2014-Zhuhai-Polymer
zoomquiet
0
400
TEDxJLUZH MOMENT future
zoomquiet
0
360
Other Decks in Technology
See All in Technology
AWS_MCP_Servers入門.pdf
naotoiso
0
210
チェックツールを導入したけど使ってもらえなかった話 #GAADjp
lycorptech_jp
PRO
1
150
Lakehouse в Лемана Тех. От архитектуры до оптимизации
emeremyanina1234
0
510
MagicPod MCPサーバー開発の裏側とAIエージェント活用の展望
magicpod
0
330
Google CloudのAI Agent関連のサービス紹介
shukob
0
180
計装を見直してアプリケーションパフォーマンスを改善させた話
donkomura
2
220
人間性を捧げる生成AI時代の技術選定
yo4raw
2
1.2k
SaaS公式MCPサーバーをリリースして得た学び
kawamataryo
5
1.5k
スキーマと型で拓く Full-Stack TypeScript / TSKaigi 2025
altech
2
620
newmo の創業を支える Software Architecture と Platform Engineering
110y
5
780
フロントエンドがTypeScriptなら、バックエンドはPHPでもいいじゃない/php-is-not-bad
hanhan1978
3
180
DataEngineeringとCloudNativeの今と未来
foursue
0
230
Featured
See All Featured
Balancing Empowerment & Direction
lara
0
49
Designing Experiences People Love
moore
142
24k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
It's Worth the Effort
3n
184
28k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A designer walks into a library…
pauljervisheath
205
24k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
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