How Do I determine peak memory usage per request?

blov · · 777 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m wanting to profile some stats on my live application to get an idea of peak memory usage for my various microservices. I&#39;m looking through the runtime package to see what would be the easiest. Would I need to run func (*MemProfileRecord) InUseBytes in every part of the system, or can I just run ReadMemStats at the end of each request? The issue with that I&#39;m seeing is that while it shows current memory usage and the total allocations, neither of those necessarily shows what I&#39;m looking for. I&#39;m trying to optimize the number of concurrent requests that I can process on a given instance size.</p> <hr/>**评论:**<br/><br/>jerf: <pre><p>While those stats may not be precisely what you&#39;re looking for, it&#39;s likely that &#34;precisely what you&#39;re looking for&#34; would turn out to be very difficult to define if push came to shove. There&#39;s a similar question that gets asked by new Linux administrators, &#34;How much memory is a given process using?&#34;, and it&#39;s really difficult to nail down what that question even means in the presence of shared memory. Those numbers are probably close enough that optimizing them will tend to do what you&#39;re looking to do.</p></pre>Ploobers: <pre><p>Thanks for the suggestion.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

777 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传