Statistiques rapides
Beaucoup d'entre vous s'étaient plaints d'avoir des statistiques trop lentes en affichage spécialement sur de grosses missions et quand le serveur est très sollicité. Il peut y avoir 2 raisons à cela:
- Votre base de données de campagne MySQL a besoin d'être réparée. Cela se traduit par des requêtes SQL longues à se réaliser. Une simple analyse MySQL et les outils de gestion de bases peuvent suffire à résoudre ce problème.
- Plus fondamentalement, les pages de statistiques sont générées dynamiquement. Cela signifie que chaque fois qu'une page de statistiques est appelée en affichage, elle est générée entièrement à partir de zéro. Cela peut occasionner des baisses de performance surtout si de nombreuses personnes le font au même instant, ce qui est le cas en fin de mission. MySQL peut être configuré pour des requêtes sur le cache SQL mais cela ne suffit pas à améliorer beaucoup les performances.
SEOW Statistics Cache
From Statistics v1.127, SEOW offers a "caching" tool for all statistics pages. This is somewhat of a misnomer because the new feature does not really produce a cache, rather it produces pre-built static HTML pages that engender very little server load to distribute to requesting clients.
The Statistics Cache is enabled/disabled by setting the following configuration variable in MP4/Statistics/MP-StatisticsMetadata.php:
$StatsUseCache = true; //Enable statistics page caching tools.
To use the conventional Statistics code, simply set this variable to false. Once enabled, and for each active campaign, the Statistics page will provide three cache management links under the campaign link. These links are "update", "rebuild" and "manual".
update This link should be clicked after each mission is analyzed. This will set off a chain of Statistics scripts that will create a static HTML page for the latest mission, and update the appropriate dependent pages (individual pilot details, cumulative losses, and the campaign mission history page). This may take some time if the number of pilots in the latest mission was large, so let this page run until you see the cache performance text appear at the bottom of the page.
rebuild This link should only be clicked to build ALL necessary statistics pages for a campaign. This will set off a chain of Statistics scripts that will create a static HTML page for ALL the missions, and update ALL dependent pages (individual pilot details, cumulative losses, and the campaign mission history page). This may take a LONG time if the number of pilots in the campaign is large and there are many missions, so let this page run until you see the cache performance text appear at the bottom of the page.
manual This link allows you to bypass the static HTML pages and use the conventional dynamic rendering code.
Where are the cache pages located?
Whenever a cache is enabled and built, the cache is stored in a subfolder of the MP4/Statistics folder. Note that the web server must permit the MP to create these subfolders when necessary. The subfolder name is the same as the campaign sector name with spaces removed, e.g. "Normandy", or "KhalkhinGol". The statistics home page in each subfolder is called index.html. This means you can publish links to the campaign statistics cache very easily, so your commanders and pilots do not have to know about the cache tools page and always get the benefit of the static HTML statistics.
For example, if your MP4 address is
http://your.SEOW.server/SEOW/MP4public/
and you are running a Philippines campaign for 100 pilots, simply enable your Statistics cache, keep it updated after each mission, and tell your pilots that the campaign statistics are located at
http://your.SEOW.server/SEOW/MP4public/Statistics/Philippines/
Your web server will get the same number of page hits as normal, but it will take a minuscule fraction of the effort to serve the stats pages to your friends.
Traduction initiale : PA-Dore 2008, mises à jour C6_Dore 2008 - 2014