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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Zoom.Quiet
November 17, 2014
Technology
0
180
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
160
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
130
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
110
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
130
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
150
PyCon2014China-Zhuhai-jeff
zoomquiet
0
120
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
150
DevFest2014-Zhuhai-Polymer
zoomquiet
0
450
TEDxJLUZH MOMENT future
zoomquiet
0
410
Other Decks in Technology
See All in Technology
FASTでAIエージェントを作りまくろう!
yukiogawa
4
140
Phase06_ClaudeCode実践
overflowinc
0
2.3k
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
240
脳が溶けた話 / Melted Brain
keisuke69
1
1.1k
「活動」は激変する。「ベース」は変わらない ~ 4つの軸で捉える_AI時代ソフトウェア開発マネジメント
sentokun
0
110
Phase05_ClaudeCode入門
overflowinc
0
2.4k
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
0
140
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
17k
ADK + Gemini Enterprise で 外部 API 連携エージェント作るなら OAuth の仕組みを理解しておこう
kaz1437
0
220
Datadog で実現するセキュリティ対策 ~オブザーバビリティとセキュリティを 一緒にやると何がいいのか~
a2ush
0
160
MIX AUDIO EN BROADCAST
ralpherick
0
110
CloudFrontのHost Header転送設定でパケットの中身はどう変わるのか?
nagisa53
1
220
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
5.9k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
310
The untapped power of vector embeddings
frankvandijk
2
1.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
170
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing for Performance
lara
611
70k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
The Limits of Empathy - UXLibs8
cassininazir
1
270
KATA
mclloyd
PRO
35
15k
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