#7007 (Optimize PatrolsPlanner performance)
by Luc Saffre · in Developers · assigned to Luc Saffre
Résumé
Concepts sous-jacents
- #7008 (LINO_SQL_LOGLEVEL is being ignored) (by Luc Saffre in Developers assigned to Luc Saffre)
Commentaires
- 1 mois ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : I found several optimizations and released my changes to the prod site, and now the page takes a bit less than 3 seconds. That's already okay.
- 1 mois ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : Rather than trying to see it on the production server, I added a >>> show_sql_summary() to patrols.lino-framework.org/plugins/patrols.html and now focus on optimizing the query itself.
- 1 mois ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : On a development server it's easy to see the SQL queries:
$ go patrols1 $ LINO_SQL_LOGLEVEL=debug runserver
On a production server I thought that the following works:
#!/usr/bin/env python import os, sys sys.path.insert(0, '/usr/local/lino') if __name__ == "__main__": #os.environ["LINO_LOGLEVE... - 1 mois ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : I wrote a script showloggers.py, but SQL queries still arend't logged and I still don't see why.
from pprint import pprint from django.conf import settings import logging from logging import getLogger from django.utils.log import DEFAULT_LOGGING print(f"auto_configure_logger_names is {settings.SITE.... - 1 mois ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : Setting LINO_SQL_LOGLEVEL to DEBUG still doesn't work on the production site. I'm investigating.
- 1 mois, 2 semaines ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : The SQL log revealed that there were still many database accesses. Maybe the most important one was that every call to dd.today() caused a db access.
- 1 mois, 2 semaines ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : I wrote a little cache system that stores the calendar events and their guests per action request in memory, so that there is only one database request per day (per ar). Theoretically this should increase performance, but after releasing it, I was surprised to see that there was no difference. I now...
- 1 mois, 2 semaines ago by Luc Saffre about #7007 (Optimize PatrolsPlanner performance) : Created new Ticket #7007 (Optimize PatrolsPlanner performance).