我使用django和tastypie作为REST。
对于分析,我使用的是django-silk和下面的请求摘要:

如何分析整个流程?除数据库查询外,所需时间平均为(382至147) ms。我如何找出瓶颈和优化/规模?对于这个资源,我确实使用了@silk_profile()作为get_object_list方法,但是即使这个方法似乎也不是瓶颈。
我使用缓存来减少响应时间,但这并没有多大帮助,还有其他选择吗?
当使用loader.io进行测试时,服务器可以处理的峰值是每30秒1000个请求(这似乎非常低)。除了缓存(我已经尝试过)之外,还有什么可以帮助的呢?
发布于 2015-06-25 19:46:27
以下是一系列建议:
发布于 2015-06-29 12:48:28
- Use a profiler - profiling at local PC could make no sense if you have distributed system deployed to several machines
- Add tracing points to your code that will record some message and current time (something like [https://gist.github.com/dbf256/0f1d5d7d2c9aa70bce89](https://gist.github.com/dbf256/0f1d5d7d2c9aa70bce89)). Deploy this patched code and test it with your load-testing tool and check logs.
https://stackoverflow.com/questions/31051693
复制相似问题