GeoServer優化性能的最佳實踐:Best Practices for Optimizing Performance with GeoServer


 

 

Dear Reader,

親愛的讀者,

One of the main goals of GeoSolutions customers is to improve performance of their geospatial server. We have been improving open source tools (e.g. GeoServer and GeoWebCache) to allow for proper dissemination of large geospatial datasets in private and public cloud environments. In this post, I highlight some tricks and tips to improve performance and I also cordially invite you to a webinar on June 10th 11:00-12:00 EDT / 15:00 GMT, led by our GeoServer lead developer Andrea Aime. Check other time zones here

GeoSolutions客戶的主要目標之一是提高其地理空間服務器的性能。我們一直在改進開放源代碼工具(如GeoServer和GeoWebCache),以便在私有和公共雲環境中適當傳播大型地理空間數據集。在本文中,我將重點介紹一些提高性能的技巧和技巧,並誠摯地邀請您參加2020年6月10日11:00-12:00 EDT/15:00 GMT的網絡研討會,研討會由我們的GeoServer首席開發人員Andrea Aime主持。在這里查看其他時區。

We want to enable a client to play with maps backed by millions of geometries or terabytes of images. Proper configuration of GeoServer and the data, in particular for large datasets, will keep us in the happy zone!

我們希望讓客戶機能夠使用由數百萬幾何圖形或TB圖像支持的地圖。正確配置GeoServer和數據,特別是對於大型數據集,將使我們保持愉快的狀態!

GeoServer has been improving over the years and more options are available to the administrators to tweak its configuration. A blog posted two years ago, provides some tweaking details. Lots of things have changed since then. For example, back then the Marlin renderer was not part of the JAVA JDK. Now it is part of JDK-9 onwards (See a JaveOne presentation from Bourges about this topic). You don’t need to do this extra configuration. If you are running on JDK-8 then follow the recommendations on the blog to improve the performance when rendering images.

GeoServer這些年一直在進步,並且管理員有更多的選項來調整其配置。兩年前發布的一個博客提供了一些調整細節。但是這兩年又發生了很多的改變。例如,當時Marlin渲染器不是java jdk的一部分。現在它是JDK-9以后的一部分(參見Bourges關於這個主題的JaveOne演示)。你不需要做這個額外的配置。如果您運行的是JDK-8,那么還是請繼續按照上面博客上的建議來提高渲染圖像時的性能。

So, what do you do if you have a ½ terabyte of OSM data and want to use it as a basemap, or you want to show on a map data from areas of interest that are tessellated in grid cells with very high resolution, or you want to cache layer groups containing thousands of GeoTIFFs (e.g. see thread on gis.stackexchange)?

那么,如果你有一個½ TB的OSM數據,並希望將其用作底圖,或者希望在地圖上顯示在網格單元中以極高分辨率鑲嵌的感興趣區域的數據,或者希望緩存包含數千個GeoTIFF的圖層組(例如,請參見gis.stackexchange上的線程)?

The strategies and tricks revolve on minimizing the work to be performed by GeoServer and the database once a request is being made. This requires preparing as much as possible data in advance, selecting best formats, caching, and other strategies.  I will provide key strategies in this post, as an introduction to the topic.

這些策略和技巧圍繞着在發出請求后最小化GeoServer和數據庫要執行的工作。這需要提前准備盡可能多的數據、選擇最佳格式、緩存和其他策略。我將在這篇文章中提供關鍵策略,作為對主題的介紹。

 

 Server performance

Can I portray millions of geometries in my web client?我可以在我的web客戶端中描繪數百萬個幾何圖形嗎?

Let’s say you have an area composed of 1 million geometries. You are not always going to show everything. You pick and choose what you want to present depending on the zoom levels. This can be tricky because you also need to process the attribute data from the contained geometries (e.g. adding, averaging). There is this kind of illusion that the user is getting all the data all the time. The magic is done via a smart setup on the backend to minimize the features being retrieved.  Several approaches to tackle this issue:

假設你有一個包含1百萬個幾何圖形的區域。你並不會時刻展示所有的東西。你會根據縮放級別來選擇你希望展示的東西。這可能很棘手,因為您還需要處理包含幾何體的屬性數據(例如,添加、平均)。存在這樣一種錯覺,即用戶一直在獲取所有數據。魔術是通過一個智能設置在后端,以盡量減少正在檢索的功能。解決這一問題的幾種方法:

1) Reduce the number of features being returned. You want super fast performance, present maximum 1000 features.

1)減少返回的要素的數量。你想要超快的性能,那么最多返回1000個要素。

Pre-configure and select what to show at different levels (e.g. via style optimizations). As the user zooms-in, the data presented changes. New features and new labels might show-up, while others disappear.

預配置,並且選擇不同級別下的展示內容(例如,通過樣式優化)。當用戶放大時,展示的數據改變了。新的要素和新的標簽可能展示出來,而其他的消失。

Create bigger geometries that are composed of smaller geometries. The geometries returned depend on the zoom level of the request or the information of the request. When done properly discrete grids are an incredible mechanism to compute fast analytics. A good read about this topic is the  OGC Discrete Global Grid System (DGGS). There is also related work going on, which we are helping to advance, as part of the  OGC Testbed 16.

創建由較小幾何體組成的較大幾何體。返回的幾何圖形取決於請求的縮放級別或請求的信息。如果做得好,離散網格是計算快速分析的難以置信的機制。關於這個主題的一本好書是OGC離散全球網格系統(DGGS)。作為ogctestbed16的一部分,我們正在幫助推進相關的工作。

2) Simplify the vertices of the polygon. For example, if a polygon has 500,000 vertices at a higher zoom level the same polygon can be represented in hundreds of vertices and the end user should not notice the difference. The tutorial for using GeoTools Feature-pregenralized module explains this in detail.

2) 簡化多邊形的頂點。例如,如果一個多邊形在更高的縮放級別上有500000個頂點,那么同一個多邊形可以用數百個頂點來表示,最終用戶不應該注意到這一差異。使用GeoTools功能預加密模塊的教程對此進行了詳細說明。

Can I serve petabytes of raster data with GeoServer?我可以用GeoServer提供數PB的光柵數據嗎?

The answer is yes, but you need to properly configure them. Regarding formats GeoTIFF is the champion. It is very flexible, can be tiled and can be fined tuned for performance.  

回答是可以,但是你需要合理的配置它們。關於格式,GeoTIFF是冠軍。它是非常靈活的,可以平鋪,可以微調性能。

How do you structure a GeoTIFF? There are several structures such as structuring the data in a Single GeoTiff, in a Mosaic or in a Pyramid.

你如何組織一個GeoTIFF?有幾種結構,例如在單個GeoTiff、馬賽克或金字塔中構造數據。

GeoTIFF Structures

The structure strategy basically depends on the size of the data, and the dimensions. 

結構策略基本上取決於數據的大小和維度。

  • If single granules are < 20 Gb, using Single GeoTiffs are a good choice.如果單個顆粒<20gb,則使用單個geotiff是一個不錯的選擇。
  • If files are > 20 Gb or you have too many dimensions (e.g. numerical models might have multiple times, elevation and others), then use ImageMosaics.如果文件大於20 Gb或有更多維度(例如,數值模型可能有多次、高程等),請使用ImageMosaics。
  • If the dataset if tremendously large and the data needs to be served at different resolutions, then ImagePyramid is the best option.如果數據集非常大,需要以不同的分辨率提供數據,那么ImagePyramid是最佳選擇。

With the above approaches we have served satellite imagery covering the entire planet, as well as long time series of meteorological models, and the like, up to several petabytes of backend data.

通過上述方法,我們提供了覆蓋整個地球的衛星圖像,以及長時間序列的氣象模型等,高達數PB的后端數據。

As said before, I have only provided some tips and tricks in this post. Don’t miss our webinar and register, so you will have the opportunity to hear more about this topic and ask anything you want to Andrea.

 如前所述,我在這篇文章中只提供了一些提示和技巧。不要錯過我們的網絡研討會和注冊,這樣你就有機會聽到更多關於這個話題,並問任何你想問的問題。

 

Hope to see you virtually on June 10th, meanwhile stay safe and keep strong!希望6月10日能見到你,同時保持疫情期間的安全和強壯!

Cordially,熱忱地,

Luis路易斯

原文: https://www.geosolutionsgroup.com/news/geoserver-performance-2020-webinar/

>>相關:Serving OSM Data with GeoServer – Advanced Styling:https://www.geosolutionsgroup.com/news/geoserver-osm-webinar-1/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM