1,用 CPU instruction(指标)来衡量程序使用CPU的情况,
CPU instrcution
Stable regardless of runtime enviroment
Measure via hardware conters on Linux
Why do we define effciency regression (恶化)
Use more CPU insr to serve one request
可能由于new release code or config change
dynostats Instgram自己开发的检测工具 只能提供request-level metrics
Cprofile 提供 Function-levle perf measurment
Python built-in profiling tool
INSTALAB prevent regression
CPytho不能跑多线程 muti-processes
CPython是用C语言实现的Python解释器。作为官方实现,它是最广泛使用的Python解释器。除了CPython以外,还有用Java实现的Jython,用.NET实现的IronPython,使Python方便地和Java程序、.NET程序集成。另外还有一些实验性的Python解释器比如PyPy。
优化python的 master-worker model
使用uWSGI的 shared memory 把worker的配置信息都放在master的内存中,然后映射。
用CYTHON来做代码优化
快速部署Python应用:Nginx+uWSGI配置详解
参考
https://python.freelycode.com/contribution/detail/509