Gateway网络请求并发重构
<p>[toc]</p>
<h1>调整设计图</h1>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/e53898b432dd9cb6b92e204088008a0a" alt="" /></p>
<h1>更新计划</h1>
<ul>
<li>先更新到测试服上.先测试一波</li>
<li>然后再更新到dev发布.</li>
</ul>
<h1>新的pprof使用</h1>
<pre><code class="language-go">// 下面会用到各个服务的端口
const (
C_PPROF_PORT_STATIC = 9001
C_PPROF_PORT_MESSAGE = 9002
C_PPROF_PORT_GAME = 9003
C_PPROF_PORT_GATEWAY = 9004
)
// 浏览器中查看服务性能指标图表(注意端口对应不同的服务)
http://localhost:9003/debug/charts
// 对服务性能做采样并用浏览器查看相关数据(分析时用)
// Cpu
$go tool pprof -http=:8888 http://localhost:9003/debug/pprof/profile?seconds=30
// Memory
$go tool pprof -http=:8888 http://localhost:9003/debug/pprof/profile?seconds=30
// ...
</code></pre>