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
88
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
64
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
66
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
45
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
54
PyCon2014China-Zhuhai-jeff
zoomquiet
0
46
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
60
DevFest2014-Zhuhai-Polymer
zoomquiet
0
300
TEDxJLUZH MOMENT future
zoomquiet
0
270
Other Decks in Technology
See All in Technology
サイボウズのQAエンジニア育成
cybozuinsideout
PRO
3
570
滑空スポーツ講習会2023 航空安全講習会 第4回 日常整備に役立ちそうな雑情報 / JSA Safety Seminar 2023 glider maintenance
jsaseminar
0
110
パフォーマンスを改善するには仕様変更が1番はやい
yamamotohiroya
12
4.6k
【OpenAI本出版記念】npakaによるOpenAI最新技術情報と技術情報キャッチアップ術
npaka
8
1.5k
GitHub composite actions
hkusu
1
120
Feature Flag Deep Dive
biwashi
20
5.1k
OCI Data Science Service 製品概要
oracle4engineer
PRO
0
110
layerx-0-to-1-product-development-in-compound-startups
shnjtk
1
520
すべてが #Zenoh になる
takasehideki
0
100
The Twelve-Factor App とクラウドアプリケーションのコスト
ny7760
3
260
【Cyber-sec+】ログの森で出会ったCloudTrail との奇妙な旅
hssh2_bin
1
230
SwiftUIのpropertyWrapperをふんわり理解する
jambo_develop_team
0
110
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
YesSQL, Process and Tooling at Scale
rocio
160
13k
Keith and Marios Guide to Fast Websites
keithpitt
407
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
11
1.4k
Building Effective Engineering Teams - LeadDev
addyosmani
25
1.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
355
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
18
1.8k
BBQ
matthewcrist
78
8.7k
The Invisible Customer
myddelton
114
12k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Web development in the modern age
philhawksworth
201
10k
Practical Orchestrator
shlominoach
180
9.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