Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows Azure 表格儲存服務效能調優三大關鍵設定

編輯:XP 系統應用技巧

使用 Windows Azure 表格儲存服務時,預設連線限制與 HTTP 協定行為可能成為效能瓶頸。以下三項設定可顯著提升高併發場景下的吞吐量與回應速度。

1. 提高預設連線上限

預設 ServicePointManager.DefaultConnectionLimit 僅 2,嚴重限制並發。在 app.config 或程式碼中調大:

<system.net>
  <connectionManagement>
    <add address="*" maxconnection="24" />
  </connectionManagement>
</system.net>

或程式碼:ServicePointManager.DefaultConnectionLimit = 24;

2. 關閉 100-Continue 行為

HTTP 1.1 預設會先送 Expect: 100-continue 等待伺服器回應,增加延遲。關閉它:

<system.net>
  <settings>
    <servicePointManager expect100Continue="false" />
  </settings>
</system.net>

程式碼:ServicePointManager.Expect100Continue = false;

3. 唯讀查詢關閉 Context 追蹤

若僅執行查詢操作,關閉實體追蹤可減少記憶體與 CPU 開銷:

context.MergeOption = MergeOption.NoTracking;

套用上述三項設定後,表格服務在大量並發讀寫場景下表現將明顯改善。

Copyright © Windows教程網 All Rights Reserved