Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: Project page with a list of components loads slowly when there are many components #7254

Closed
2 tasks done
endervad opened this issue Feb 14, 2022 · 1 comment
Closed
2 tasks done
Assignees
Milestone

Comments

@endervad
Copy link

endervad commented Feb 14, 2022

Describe the issue

My project has a huge amount of components, about 5000. Each component has at least 4 languages in it. When I go to the project page that has a list of all components ( https://example.com/projects/project-name/ ), Weblate separates them into pages, 100 of components each, but it still loads kinda slow, for about 8 seconds. This makes navigating between pages a bit of a pain and it also heavily loads the CPU. Also I noticed that decreasing page size via URL doesn't change load speed, soo it seems like Weblate loads all of the components at every page instead of only 100 or whatever page size is.
Using component lists partially mitigates this issue, but it also has a problem: it doesn't separate components into pages at all, so for some big lists it naturally takes a while to load (should I make a separate issue about it?).
I host Weblate on my PC but it's not exactly a weak one: Intel Core i9-9900K (8 @ 3.6GHz with HT & up to 5GHz) with 8Gb RAM given to Weblate container.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

My project is public so you can see it for yourself:

It takes about 8 seconds for both of them to load.

Expected behavior

Weblate should load only the number of components defined by page size, not all of the for every page.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.10.1
  • Django: 4.0
  • siphashc: 2.1
  • translate-toolkit: 3.5.1
  • lxml: 4.7.1
  • Pillow: 8.4.0
  • bleach: 4.1.0
  • python-dateutil: 2.8.2
  • social-auth-core: 4.1.0
  • social-auth-app-django: 5.0.0
  • django-crispy-forms: 1.13.0
  • oauthlib: 3.1.1
  • django-compressor: 3.1
  • djangorestframework: 3.13.1
  • django-filter: 21.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.4.0
  • setuptools: 60.0.4
  • jellyfish: 0.8.9
  • openpyxl: 3.0.9
  • celery: 5.2.1
  • kombu: 5.2.2
  • translation-finder: 2.10
  • weblate-language-data: 2021.7
  • html2text: 2020.1.16
  • pycairo: 1.20.1
  • pygobject: 3.42.0
  • diff-match-patch: 20200713
  • requests: 2.26.0
  • django-redis: 5.2.0
  • hiredis: 2.0.0
  • sentry_sdk: 1.5.1
  • Cython: 0.29.26
  • misaka: 2.1.1
  • GitPython: 3.1.24
  • borgbackup: 1.1.17
  • pyparsing: 3.0.6
  • pyahocorasick: 1.4.2
  • python-redis-lock: 3.7.0
  • Python: 3.10.1
  • Git: 2.30.2
  • psycopg2: 2.9.2
  • psycopg2-binary: 2.9.2
  • phply: 1.2.5
  • chardet: 4.0.0
  • ruamel.yaml: 0.17.17
  • tesserocr: 2.5.2
  • akismet: 1.1
  • boto3: 1.20.26
  • zeep: 4.1.0
  • aeidon: 1.10.1
  • iniparse: 0.5
  • mysqlclient: 2.1.0
  • Mercurial: 6.0
  • git-svn: 2.30.2
  • git-review: 2.2.0
  • Redis server: 6.2.6
  • PostgreSQL server: 13.5
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: smtp.gmail.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 5.10.60.1-microsoft-standard-WSL2 (x86_64)

Weblate deploy checks

System check identified some issues:

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.10.1/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/weblate-4.10.1/admin/backup.html

System check identified 2 issues (1 silenced).

Additional context

I changed the number of workers in docker-compose.override.yml to the following:

WEBLATE_WORKERS: 8
WEB_WORKERS: 8
nijel added a commit that referenced this issue Feb 14, 2022
This heavily reduces number of queries on massively shared repos.

Issue #7254
nijel added a commit that referenced this issue Feb 14, 2022
It is way better to let the SQL server to do the hard word of joining
instead of building a complex query in Python.

Issue #7254
@nijel nijel self-assigned this Feb 18, 2022
@nijel nijel added this to the 4.11 milestone Feb 18, 2022
@nijel nijel closed this as completed in 63b8de4 Feb 18, 2022
@github-actions
Copy link

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants