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
120
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
91
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
66
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
68
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
46
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
57
PyCon2014China-Zhuhai-jeff
zoomquiet
0
46
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
61
DevFest2014-Zhuhai-Polymer
zoomquiet
0
310
TEDxJLUZH MOMENT future
zoomquiet
0
270
Other Decks in Technology
See All in Technology
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
3
750
「ふりかえりのふりかえり」をふりかえり、実のあるふりかえりにする
naitosatoshi
0
220
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs (QCon London)
inesmontani
PRO
1
150
PHPカンファレンス小田原2024
ysknsid25
3
660
DevOpsメトリクスとアウトカムの接続にトライ!開発プロセスを通して計測できるメトリクスの活用方法
ham0215
1
180
カオナビの利用実績をアウトカムへつなげる旅 / example-of-data-management-startup-in-kaonavi
kaonavi
0
120
オブザーバビリティの Primary Signals
onk
PRO
0
540
開発生産性向上サービスを作るFindyが自分たちで開発生産性を爆上げした組織づくりの歩み / Findy's path to boosting its own development productivity 2024-04-17
ma3tk
3
300
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
1.9k
レガシーをぶっ壊せ。AEONで始めるDevRelの話 / Qiita Night 2024-2-22
aeonpeople
3
150
インシデントレスポンスのライフサイクルを廻すポイントってなに / Pinpoints of Incidentresponse Lifecycle for Operation
sakaitakeshi
1
300
Apple Vision Pro trial session
akkeylab
0
120
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
91
13k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
243
20k
Visualization
eitanlees
135
14k
YesSQL, Process and Tooling at Scale
rocio
163
13k
The Pragmatic Product Professional
lauravandoore
24
5.8k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
4 Signs Your Business is Dying
shpigford
175
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
20
1.6k
[RailsConf 2023] Rails as a piece of cake
palkan
22
3.9k
Adopting Sorbet at Scale
ufuk
67
8.6k
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