虚心使人进步

虚心学习,天天向上......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Mitmproxy的mimdump mimproxy mitmweb命令行性能对比

Posted on 2019-10-11 09:45  Showker  阅读(1183)  评论(0编辑  收藏  举报

引用官方的原话如下

Very cool test - thanks for sharing! 😃 We actually started out building some performance measurements a few weeks ago: https://github.com/mitmproxy/mitmproxy/tree/master/test/bench.

I need to understand, am I doing something wrong on my end ? or is this an expected behaviour ?

This is not expected behaviour, but may very well be an issue with our current architecture. @cortesi will probably be very interested in looking into this, he is in the process of replacing our eventloop with something asyncio-based to increase performance. If this works as planned, it should tackle exactly our problem here.

For reference, the expected behaviour is as follows:

For a few requests, mitmproxy, mitmdump and mitmweb should exhibit similar performance characteristics. Mitmdump is of course a bit more lightweight than its companions, so it probably beats the others by an edge.
For long-running sessions, mitmproxy's and mitmweb's RAM usage will increase, whereas mitmdump forgets about connections once they are finished.


百度翻译过来就是(

对于一些请求,mitmproxy、mitmdump和mitmweb应该表现出类似的性能特征。当然,mitmdump比它的同伴要轻一点,所以它可能比其他人强一点。

对于长时间运行的会话,mitmproxy和mitmweb的ram使用将增加,而mitmdump在连接完成后会忘记连接。

)



Regarding your test setup: I do like that your tests are very practical, but there are many factors that can introduce noise: temporal network latencies, packet loss, HTTP edge caching, or DNS caches. If you want dependable results, I'd suggest to at least randomize test order and most importantly do multiple test runs and report on standard deviation.

Please don't hesistiate to get in touch if you have further questions, we're quite interested in the results here. :-) Thanks again!

  

所以执行长时间的任务,适合用mitmdump,之前我用mitmweb命令,10几个小时后,mac的占用内存就达到了23G。。。

改用mitmdump命令后,内存占用明显下降。

另外使用-q也就是不输出日志的静默模式,是否能有效降低内存使用,有待测试。

mitmdump -q  -p 8889 -s addons.py