SharePoint Online 效能調整的簡介Introduction to performance tuning for SharePoint Online

本文說明在 SharePoint Online 中設計最佳效能的頁面時所應考量的特定事項。This article explains what specific aspects you need to consider when designing pages for best performance in SharePoint Online.

SharePoint Online 度量資訊SharePoint Online metrics

下列廣泛的 SharePoint Online 度量值提供有關效能的實際環境資料:The following broad metrics for SharePoint Online provide real world data about performance:

  • 頁面載入速度How fast pages load

  • 每頁所需來回行程次數How many round trips required per page

  • 服務的問題Issues with the service

  • 導致效能降低的其他事項Other things that cause performance degradation

資料所導出的結論Conclusions reached because of the data

資料會告訴我們:The data tells us:

  • 大部分頁面在 SharePoint Online 上的執行狀況良好。Most of the pages perform well on SharePoint Online.

  • 非自訂頁面載入速度很快。Non-customized pages load very quickly.

  • 商務用 OneDrive、小組網站和系統頁面 (如 _layouts 等) 載入速度都很快。OneDrive for Business, team sites and system pages, such as _layouts, etc., are all quick to load.

  • 最慢的 1% SharePoint Online 頁面載入時間需要超過 5000 毫秒。The slowest 1% of SharePoint Online pages take more than 5,000 milliseconds to load.

您可使用的一項簡單基準測試是透過比較您的入口網站載入時間和商務用 OneDrive 首頁載入時間來測量效能,因其使用的自訂功能不多。One simple benchmark test you can use would be to measure performance by comparing the load time of your own portal against the load time of the OneDrive for Business home page as it uses few customized features. 在進行網路效能問題疑難排解時,這通常是支援人員要求您完成的第一個步驟。This will often be the first step Support will ask you to complete when troubleshooting network performance issues.

檢查效能時,請使用標準使用者帳戶Use a standard user account when checking performance

網站集合系統管理員、網站擁有者、編輯者或參與者皆屬於其他的安全性群組,擁有額外的權限,因此擁有 SharePoint 在頁面上載入之外的其他元素。A Site Collection Administrator, Site Owner, Editor, or Contributor belong to additional security groups, have additional permissions, and therefore have additional elements that SharePoint loads on a page.

這適用於 SharePoint 內部部署和 Sharepoint,但在內部部署狀況中,差異不會像在 SharePoint Online 中那樣容易發現。This is applicable to SharePoint on-premises and SharePoint Online but in an on-premises scenario the differences will not be as easily noticed as in SharePoint Online.

為了正確評估使用者執行頁面的效能,請使用標準使用者帳戶,以避免載入安全性群組相關的製作控制和其他流量。In order to correctly evaluate how a page will perform for users, you should use a standard user account to avoid loading the authoring controls and additional traffic related to security groups.

效能調整的連線類別Connection categories for performance tuning

您可將伺服器與使用者之間的連線分類成三種主要元件。You can categorize the connections between the server and the user into three main components. 在設計 SharePoint Online 頁面以深入瞭解載入時間時,請將這些元件納入考量。Consider these when designing SharePoint Online pages for insight into load times.

  • 伺服器:Microsoft 在資料中心主控的伺服器。Server The servers that Microsoft hosts in datacenters.

  • 網路:Microsoft 網路、網際網路以及資料中心和您的使用者之間的內部部署網路。Network The Microsoft network, the Internet, and your on-premises network between the datacenter and your users.

  • 瀏覽器:載入頁面所在。Browser Where the page is loaded.

在這三種連線中,通常有五個原因會造成 95% 的頁面緩慢情形。Within these three connections there are typically five reasons that cause 95% of slow pages. 本文將討論這些原因:Each of these reasons is discussed in this article:

  • 瀏覽問題Navigation issues

  • 內容彙總Content roll up

  • 大型檔案Large files

  • 對伺服器的要求太多Many requests to the server

  • 網頁組件處理Web Part processing

伺服器連線Server connection

許多影響 SharePoint 內部部署效能的問題也會在 SharePoint Online 上出現。Many of the issues that affect performance with SharePoint on-premises also apply to SharePoint Online.

一如預期,您有許多手段可控制伺服器在內部部署 SharePoint 中的執行效能。As you would expect, you have far more control over how servers perform with on-premises SharePoint. 但在 SharePoint Online 上,情形略有不同。With SharePoint Online things are a little different. 您讓伺服器執行的工作越多,呈現頁面所需的時間就越長。The more work you make a server do, the longer it takes to render a page. 而在 SharePoint 中,含有多個網頁組件的複雜頁面才是造成這方面問題的最大禍首。With SharePoint, the biggest culprit in this respect are complex pages with multiple web parts.

SharePoint Server 內部部署SharePoint Server on-premises

內部部署伺服器的螢幕擷取畫面

SharePoint OnlineSharePoint Online

伺服器連線的螢幕擷取畫面

在 SharePoint Online 上,某些網頁要求可能實際上最後會呼叫多部伺服器。With SharePoint Online, certain page requests may actually end up calling multiple servers. 原本只是一個要求,最後卻可能演變成涉及多部伺服器的多個要求。You could end up with a matrix of requests between servers for an individual request. 從頁面載入的觀點來看,這些互動不僅成本昂貴且會讓效率變慢。These interactions are expensive from a page load perspective and will make things slow.

這些伺服器對伺服器的互動範例如下:Examples of these server to server interactions are:

  • Web 對 SQL ServerWeb to SQL Servers

  • Web 對應用程式伺服器Web to application servers

另一個導致伺服器互動速度變慢的因素是快取遺漏。The other thing that can slow down server interactions is cache misses. 不同於內部部署 SharePoint,雖然機率微乎其微,但您有可能會叫用相同伺服器來取得之前造訪的頁面;這個情形會讓物件快取過時。Unlike on-premises SharePoint, there is a very slim chance that you will hit the same server for a page that you have visited previously; this makes object caching obsolete.

網路連線Network connection

在未利用 WAN 的內部部署 SharePoint 中,您可以在資料中心與使用者之間使用高速連線。With on-premises SharePoint that doesn't make use of a WAN, you may use a high-speed connection between datacenter and end-users. 從網路的觀點來看,這通常能簡化管理程序。Generally, things are easy to manage from a network perspective.

在 SharePoint Online 上,則還要再考慮幾個因素,例如:With SharePoint Online, there are a few more factors to consider; for example:

  • Microsoft 網路The Microsoft network

  • 網際網路The Internet

  • ISPThe ISP

不論您使用哪個 SharePoint (和那個網路) 版本,會導致網路忙碌的因素通常包括:Regardless of which version of SharePoint (and which network) you are using, things that will typically cause the network to be busy include:

  • 承載過大Large payload

  • 檔案太多Many files

  • 與伺服器的實體距離太遠Large physical distance to the server

您可以在 SharePoint Online 中利用的其中一項功能為 Microsoft CDN (內容傳遞網路)。One feature that you can leverage in SharePoint Online is the Microsoft CDN (Content Delivery Network). CDN 基本上是部署到多個資料中心的分散式伺服器集合。A CDN is basically a distributed collection of servers deployed across multiple datacenters. 使用 CDN 時,頁面上的內容可裝載於接近用戶端的伺服器,即便用戶端離原始 SharePoint 伺服器很遠。With a CDN, content on pages can be hosted on a server close to the client even if the client is far away from the originating SharePoint Server. Microsoft 未來將多加利用此功能來儲存無法自訂之頁面的本機執行個體,例如 SharePoint Online 管理首頁。Microsoft will be using this more in the future to store local instances of pages which cannot be customized, for example the SharePoint Online admin home page. 如需有關 CDN 的詳細資訊,請參閱內容傳遞網路 (部分機器翻譯)。For more information about CDNs, see Content delivery networks.

您必須注意但可能無能為力的因素是您的 ISP 連線速度。Something that you need to be aware of but may not be able to do much about is the connection speed of your ISP. 簡單的速度測試工具會告訴您連線速度。A simple speed test tool will tell you the connection speed.

瀏覽器連線Browser connection

從效能的觀點來看,有幾個與網頁瀏覽器有關的因素要考慮進去。There are a few factors to consider with web browsers from a performance perspective.

造訪複雜頁面會影響效能。Visiting complex pages will affect performance. 大部分瀏覽器的快取都很小 (大約 90 MB),而平均網頁大小通常是 1.6 MB 左右。Most browsers only have a small cache (around 90MB), while the average web page is typically around 1.6MB. 不需要多久時間就會把快取用完。This doesn't take long to get used up.

頻寬可能也是個問題。Bandwidth may also be an issue. 例如,若使用者在另一個工作階段中觀看影片,則會影響您的 SharePoint 網頁效能。For example, if a user is watching videos in another session, this will affect the performance of your SharePoint page. 您無法阻止使用者串流媒體,但可控制為使用者載入頁面的方式。While you can't prevent users from streaming media, you can control the way a page will load for users.

請看下列文章來取得不同的 SharePoint Online 頁面自訂技術和其他最佳作法,以協助您達到最佳效能。Check out the following articles for different SharePoint Online page customization techniques and other best practices to help you achieve optimal performance.