go1.6升級帶來響應延遲的問題

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

Go1.6 放出來很久了,這裡是 Release,比較注意一點 Map 不加鎖在並發訪問時會 Crash.

先說問題:升級go1.6後,線上的GC時間顯顯變短,但是回應時間變大,不可接受。


這幾個小時完全不能接受



線上響應

顯顯看到 小於1ms的請求大幅減少,1ms~10ms請求突增,如果每個請求1ms,整體QPS猛降到1000,完全不能接受。


升級後

系統日誌看升級後延遲好大


升級前

對比升級前的響應,基本不到1ms

不知道已入坑的同學,有無遇到這個問題。在官方的 Issues 也提到過,需要進一步的測試

疑似記憶體流失問題20160315

因為升級go1.6有一個map並發訪問的問題,所以在 go install 的時間增加了 -race選項

The runtime has added lightweight, best-effort detection of concurrent misuse of maps. As always, if one goroutine is writing to a map, no other goroutine should be reading or writing the map concurrently. If the runtime detects this condition, it prints a diagnosis and crashes the program. The best way to find out more about the problem is to run it under therace detector, which will more reliably identify the race and give more detail.

The compiler, linker, and go command have a new-msanflag analogous to -race and only available on linux/amd64, that enables interoperation with theClang MemorySanitizer. This is useful for testing a program containing suspect C or C++ code. You might like to try it while testing your cgo code with the new pointer rules.

測試程式通過後,直接部署到線了,過了半天發現記憶體吃沒了


TOP

後來把 -race選項去掉就好了,還是理解不透,汗!

去掉後線上響應也正常了


回應時間
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.