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

Automatic Translation using Weblate TM became "very expensive" with v4.3 #4703

Closed
ilocit opened this issue Oct 16, 2020 · 13 comments
Closed
Assignees
Labels
bug Something is broken.
Milestone

Comments

@ilocit
Copy link
Contributor

ilocit commented Oct 16, 2020

Describe the bug

When you pre-translate an update with translations from Weblate Translation Memory, this seems to be very "expensinve" in terms of CPU (and also mem) usage because of postgres processes. Running auto trans from other components seems as fast as before, so does MT. But not from Weblate Translation Memory!

To Reproduce

Update resources with latest sprint data

  1. Go to 'Tools'
  2. Click on 'Automatic Translation'
  3. Select 'Machine Translation' under 'Automatic translation source'
  4. Choose "Weblate Translation Memory" from available options

Screenshots

Taking very, very long...
image

CPU usage:
image

Server configuration and status

Docker Weblate v 4.3

@nijel
Copy link
Member

nijel commented Oct 17, 2020

There is already improvement scheduled for 4.3.1

@nijel nijel added the bug Something is broken. label Oct 17, 2020
@nijel nijel added this to the 4.3.1 milestone Oct 17, 2020
@nijel nijel self-assigned this Oct 17, 2020
@nijel
Copy link
Member

nijel commented Oct 17, 2020

Should be addresed by 241dd91

@nijel nijel closed this as completed Oct 17, 2020
@github-actions
Copy link

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

@ilocit
Copy link
Contributor Author

ilocit commented Oct 27, 2020

There is still something wrong with the performance, I guess. A project I am upadting right now has 28 new strings. Running the "pre-translation from TM" still takes really long. Like 2 minutes.
This is what the CPU usage looks like:
image

@nijel
Copy link
Member

nijel commented Oct 27, 2020

Are you already running 4.3.1? The automatic translation can be responsible only for one of the PostgreSQL connections, the other two must be caused by something else.

On the other side I also think it still performs worse than in 4.2 and I don't see any obvious reason for that.

@ilocit
Copy link
Contributor Author

ilocit commented Oct 27, 2020

Yes, the instance was updated to 4.3.1 already. Maybe another user is running an auto-translation or search at the same time. Especially for long strings, the search really takes a couple seconds, even when translating and using Automatic Suggestions.

@ilocit
Copy link
Contributor Author

ilocit commented Oct 27, 2020

A search for this in MT and TM takes about 5 sec until a result is shown.
image
That is the time you will see the spinning wheel to indicate that the search is being performed. In some similar cases it takes the same 5 seconds to return the MT results but another 10 seconds after that to display results from the TM.

@nijel
Copy link
Member

nijel commented Oct 27, 2020

That's horrible performance. I've just tested that on https://translate.fedoraproject.org/ (which has the biggest translation memory from the publicly available instances) and the TM results take around 300ms there. Did it really change with the 4.3 release for you? There were almost no code changes between 4.2 and 4.3 in terms of translation memory (and definitely no changes in the lookup code).

@ilocit
Copy link
Contributor Author

ilocit commented Oct 28, 2020

I am not sure, actually. But we did not have any complaints from translators recently, only after we switched to 4.3
Maybe it is also the combination of MT and TM? I see that fedora does not use MT. It seems that first MT providers are called and then, once finished, the TM is quried, no? At least that is how the search results come in when you navigate to Automatic Suggestions.

@ilocit
Copy link
Contributor Author

ilocit commented Oct 28, 2020

Now I am trying to pre-translate 410 strings (2122 words) into Finnish from weblate and weblate TM. There is litterally now progress in the past 10min. The process is still running at almost 100%.
image
There is definitly something wrong. Maybe some migration issue with the DB after upgrading to 4.3? The migration of the db took much longer during the upgrade from 4.2. to 4.3 then it ever took after you moved to postgres.

@nijel
Copy link
Member

nijel commented Oct 31, 2020

The migration to 4.3 is expected to take long, see https://docs.weblate.org/en/latest/admin/upgrade.html#upgrade-from-4-2-to-4-3

Let's skip the autotranslate part for now and let's take a look at TM performance. Did that change when upgrading to 4.3? There are no changes in that code between these releases. Maybe the database performance just got worse for some reason. Any changes in hardware or VM setup?

@ilocit
Copy link
Contributor Author

ilocit commented Nov 2, 2020 via email

@nijel
Copy link
Member

nijel commented Nov 3, 2020

Deleting big amount of the TM entries would most likely trigger autovacuum on PostgreSQL, what can quite likely improve the database performance.

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

No branches or pull requests

2 participants