https://layers.openembedded.org/layerindex/stats/ (also available to logged in users from the Tools -> Statistics menu) times out with 504 Gateway Time-out. This means that nginx gave up waiting for Django to respond to the request. On the server side, we can see: [2024-02-07 18:50:59 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:28) [2024-02-07 18:51:00 +0000] [1] [ERROR] Worker (pid:28) was sent SIGKILL! Perhaps out of memory? In this context, WORKER is most likely a gunicorn worker. The code behind this view is: https://git.yoctoproject.org/layerindex-web/tree/layerindex/views.py#n1512 And the template is: https://git.yoctoproject.org/layerindex-web/tree/templates/layerindex/stats.html If you comment out the context['perbranch'] annotate code in StatsView class, the code succeeds: Statistics Overall Layers 541 Recipes 25843 (distinct names) Machines 1468 (distinct names) Classes 1620 (distinct names) Distros 194 (distinct names) So the problem is too much data (in memory presumably) in this code: context['perbranch'] = Branch.objects.filter(hidden=False).order_by('sort_priority').annotate( layer_count=Count('layerbranch', distinct=True), recipe_count=Count('layerbranch__recipe', distinct=True), class_count=Count('layerbranch__bbclass', distinct=True), machine_count=Count('layerbranch__machine', distinct=True), distro_count=Count('layerbranch__distro', distinct=True)) We should probably instead loop over each branch individually? This would hopefully allow caching of each branch and be friendlier to the gunicorn worker.
https://lists.yoctoproject.org/g/yocto-patches/topic/119236981 https://lists.yoctoproject.org/g/yocto-patches/topic/119236982
Merged. https://git.yoctoproject.org/layerindex-web/commit/?id=e81f245edd0b31d411f8cb31b294dab3181a1832 https://git.yoctoproject.org/layerindex-web/commit/?id=45c07d2b632f30e2faa0791b6f3f13ef09253946