07.12.2016 Views

Performance de QGIS Server

02_performance_qgis_server

02_performance_qgis_server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Performance</strong> <strong>de</strong> <strong>QGIS</strong> <strong>Server</strong><br />

<strong>QGIS</strong> joue dans la cour <strong>de</strong>s grands !


Problématique<br />

■ Comment définir le concept <strong>de</strong> performances et le<br />

mesurer<br />

■ Historique<br />

■ Framework <strong>de</strong> tests <strong>de</strong> performances<br />

■ Quelques retours<br />

www.camptocamp.com /<br />

2/28


<strong>Performance</strong> : une définition<br />

Indications chiffrées mesurant les possibilités<br />

maximales ou optimales d'un matériel, d'un logiciel,<br />

d'un système ou d'un procédé technique pour exécuter<br />

une tâche donnée.<br />

Source : Wikipedia<br />

www.camptocamp.com /<br />

3/28


<strong>Performance</strong> : les mesures<br />

■ Selon le contexte, les performances incluent les mesures<br />

suivantes:<br />

○ Un faible temps <strong>de</strong> réponse pour effectuer une tâche donnée<br />

○ Un débit élevé (vitesse d'exécution d'une tâche)<br />

○ L'efficience : faible utilisation <strong>de</strong>s ressources informatiques :<br />

processeur, mémoire, stockage, réseau, consommation électrique,<br />

etc.<br />

○ Une haute disponibilité du système ou <strong>de</strong> l'application<br />

○ Une ban<strong>de</strong> passante élevée ou une faible latence<br />

○ Le passage à l'échelle (scalabilité)<br />

○ La capacité d'un canal <strong>de</strong> communication<br />

○ La performance du stockage informatique<br />

www.camptocamp.com /<br />

4/28


Limite <strong>de</strong> tests <strong>de</strong> performance<br />

■ Pertinent seulement pour le cas étudié, attention à<br />

l'extrapolation (« il est performant dans ce test, ce<br />

sera le cas avec mes données et mes cas<br />

d'utilisations »)<br />

■ Bien faire attention à ce qui est testé<br />

■ Le rendu et les données doivent être i<strong>de</strong>ntique<br />

■ L'optimisation doit être égale entre les différents<br />

éléments comparés<br />

www.camptocamp.com /<br />

5/28


Historique<br />

■ OSGeo a organisé un WMS Benchmark<br />

○ Complexe à installer<br />

○ Données à récupérer en différent endroit<br />

■ Volonté d'avoir quelque chose <strong>de</strong> facile à mettre en<br />

place, reproductible !<br />

www.camptocamp.com /<br />

6/28


Objectif <strong>de</strong> notre infrastructure<br />

■ Être reproductible : basé sur une infra docker<br />

■ Les mêmes données :<br />

○ Stocké dans une base PostGIS<br />

○ Sans optimisation avancée<br />

○ Seulement le minimum <strong>de</strong> l'état <strong>de</strong> l'art : colonnes<br />

indéxées<br />

■ Configuration <strong>de</strong>s serveurs<br />

○ mise en place <strong>de</strong>s bonnes pratiques (pool <strong>de</strong> connexion<br />

si disponible, FastCGI)<br />

www.camptocamp.com /<br />

7/28


Limite actuelle <strong>de</strong> notre infra <strong>de</strong> test<br />

■ Optimisation à améliorer<br />

○ Dangereux <strong>de</strong> comparer les services si une optimisation<br />

n'a pas été mise en place<br />

■ Tous les cas d'usage ne sont pas testés<br />

■ On ne compare pas les fonctionnalités, obligation <strong>de</strong><br />

limiter par le bas<br />

www.camptocamp.com /<br />

8/28


Infrastructure <strong>de</strong> test<br />

■ Serveur :<br />

○ CPU :<br />

- 8 cores<br />

- Intel Xeon E312xx<br />

- 2 GHz<br />

○ RAM :<br />

- 16 Go.<br />

○ Système :<br />

- Linux 3.16.0-4-amd64 x86_64<br />

■ Map<strong>Server</strong> 7.0.*<br />

■ Geo<strong>Server</strong> 2.9<br />

■ <strong>QGIS</strong> master (3.x)<br />

www.camptocamp.com /<br />

9/28


Les couches<br />

■ Ponctuel : amenities<br />

■ Linéaire : route<br />

■ Surfacique : bâtiments<br />

www.camptocamp.com /<br />

10/28


Couches ponctuelles<br />

■ Amenities<br />

Map<strong>Server</strong> Geo<strong>Server</strong> <strong>QGIS</strong>-<strong>Server</strong><br />

Simple<br />

Class<br />

www.camptocamp.com /<br />

11/28


Couches linéaires<br />

■ roads<br />

Map<strong>Server</strong> Geo<strong>Server</strong> <strong>QGIS</strong>-<strong>Server</strong><br />

Simple<br />

Hatched<br />

www.camptocamp.com /<br />

12/28


Couches surfaciques<br />

■ Buildings<br />

Map<strong>Server</strong> Geo<strong>Server</strong> <strong>QGIS</strong>-<strong>Server</strong><br />

Simple<br />

Hatched<br />

www.camptocamp.com /<br />

13/28


Différence visuelle<br />

■ Map<strong>Server</strong> et Geo<strong>Server</strong> très proche mais :<br />

○ Bbox très légèrement différente<br />

○ Hachure difficile à reproduire<br />

○ Teinte différente<br />

■ <strong>QGIS</strong> :<br />

○ Problème <strong>de</strong> la projection CRS:84<br />

www.camptocamp.com /<br />

14/28


Benchmark<br />

www.camptocamp.com /<br />

15/28


Attention à l'optimisation !<br />

Temps (en ms)<br />

4500<br />

4000<br />

3500<br />

3000<br />

2500<br />

2000<br />

1500<br />

1000<br />

500<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'utilisateurs<br />

Geo<strong>Server</strong> optimisé<br />

Temps <strong>de</strong> génération d'une image<br />

Couche : point simple<br />

Temps (en ms)<br />

1000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

0<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

Temps <strong>de</strong> génération d'une image<br />

Couche : point simple<br />

Geo<strong>Server</strong> out-of-box<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'utilisateurs<br />

www.camptocamp.com /<br />

16/28


Évolution du nombre d'utilisateurs<br />

1000<br />

900<br />

800<br />

700<br />

Temps <strong>de</strong> génération d'une image<br />

Couche : point simple<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

Temps (en ms)<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'utilisateurs<br />

www.camptocamp.com /<br />

17/28


Évolution du nombre d'utilisateurs<br />

700<br />

Tems <strong>de</strong> génération <strong>de</strong> l'image<br />

Couche : point avec plusieurs classes<br />

600<br />

500<br />

Temps (en ms)<br />

400<br />

300<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

200<br />

100<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'utilisateurs<br />

www.camptocamp.com /<br />

18/28


Évolution du nombre d'utilisateurs<br />

6000<br />

Temps <strong>de</strong> génération d'une image<br />

Couche : linéaire simple<br />

5000<br />

4000<br />

Temps en ms<br />

3000<br />

2000<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

1000<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'utilisateur<br />

www.camptocamp.com /<br />

19/28


Évolution du nombre d'utilisateurs<br />

Temps <strong>de</strong> génération d'une image<br />

6000<br />

Couche : linéaire pointillé<br />

5000<br />

4000<br />

Temps en ms<br />

3000<br />

2000<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

1000<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'Utilisateurs<br />

www.camptocamp.com /<br />

20/28


Attention à l'optimisation !<br />

7000<br />

6000<br />

Temps <strong>de</strong> génération d'une imagte<br />

Couche : polygone simple<br />

Geo<strong>Server</strong> out-of-box<br />

Temps (en ms)<br />

5000<br />

4000<br />

3000<br />

2000<br />

1000<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbr d'utilisateurs<br />

Geo<strong>Server</strong> optimisé<br />

Temps (en ms)<br />

7000<br />

6000<br />

5000<br />

4000<br />

3000<br />

2000<br />

1000<br />

Temps <strong>de</strong> génération d'une imagte<br />

Couche : polygone simple<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbr d'utilisateurs<br />

www.camptocamp.com /<br />

21/28


Évolution du nombre d'utilisateurs<br />

7000<br />

Temps <strong>de</strong> génération d'une imagte<br />

Couche : polygone simple<br />

6000<br />

5000<br />

Temps (en ms)<br />

4000<br />

3000<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

2000<br />

1000<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbr d'utilisateurs<br />

www.camptocamp.com /<br />

22/28


Évolution du nombre d'utilisateurs<br />

Temps <strong>de</strong> génération d'une image<br />

Couche : polygone hachuré<br />

10000<br />

9000<br />

8000<br />

7000<br />

Temps en ms<br />

6000<br />

5000<br />

4000<br />

Geo<strong>Server</strong><br />

Map<strong>Server</strong><br />

<strong>QGIS</strong><br />

3000<br />

2000<br />

1000<br />

0<br />

0 5 10 15 20 25 30 35 40 45<br />

Nbre d'Utilisateurs<br />

www.camptocamp.com /<br />

23/28


1ere conclusion<br />

■ Amélioration <strong>de</strong>s performances avec Geo<strong>Server</strong><br />

○ Pas out of the box<br />

○ Plugins Control flow module manquant ?<br />

○ Désactivé certaines valeurs par défaut<br />

■ <strong>QGIS</strong> plutôt performant mais moins que les autres<br />

■ Map<strong>Server</strong> plutôt performant, out of the box<br />

www.camptocamp.com /<br />

24/28


Autres considérations<br />

■ <strong>QGIS</strong> server :<br />

○ Erreurs lors <strong>de</strong>s tests :<br />

- ~200 au total<br />

- notamment sur les polygones – ~135 erreurs<br />

○ L'écart type du temps <strong>de</strong> réponse augmente avec le<br />

nombre d'utilisateurs<br />

- Double <strong>de</strong> ceux <strong>de</strong> Map<strong>Server</strong> et Geo<strong>Server</strong><br />

www.camptocamp.com /<br />

25/28


Conclusion / todo<br />

■ Il manque un test <strong>QGIS</strong> 2.18 vs 3.x<br />

○ Des évolutions ont été apportées cette année par<br />

Camptocamp sur les performances<br />

■ Ce test permettra au prochain co<strong>de</strong> sprint <strong>de</strong><br />

s'assurer qu'il n'y a aucune régression (voire une<br />

amélioration)<br />

■ Automatiser la génération <strong>de</strong>s graphiques<br />

www.camptocamp.com /<br />

26/28


Information projet<br />

■ Github : http://github.com/camptocamp/ms_perfs<br />

■ Contactez moi : yves.jacolin@camptocamp.com<br />

■ PR bienvenues<br />

www.camptocamp.com /<br />

27/28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!