This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:

Performance issue happens with these symptoms: Translations sometimes are not saved to the database. CPU-Usage is up to 100%.

Solution:

The latest version of WooCommerce Multilingual (4.6.2) solved this issue. Please update WPML and its add-ons to their latest versions.

0% of people find this useful.

Author Posts
April 4, 2019 at 1:24 pm #3535283

richS-2

I just updated again all WPML Plugins to latest version without any difference. String stranslation is causing slow queries in front and backend.
Example:
caller: WPML_DB_Chunk->retrieve()
Plugin: sitepress-multilingual-cms
Time: 0,0902

or in the backend WPML / Translations:
caller: WPML_Translation_Job_Factory->get_translation_job_types_filter()
Plugin: wpml-translation-management
Time: 0.1230

and other callers from WPML.

CPU is also still going right up to almost 100% just by browsing the shop page. That really sucks. 🙁

April 4, 2019 at 1:35 pm #3535347

richS-2

Another slow query example from Backend / WPML / String translation

Query:
SELECT context, COUNT(context) AS c
FROM myprefix_icl_strings s
WHERE 1
AND TRIM(s.value) <> ''
GROUP BY context
ORDER BY context ASC

Caller:

1. icl_st_get_contexts()
wp-content/plugins/wpml-string-translation/inc/functions.php:820
2. WPML_ST_Strings->get_per_domain_counts()
wp-content/plugins/wpml-string-translation/classes/class-wpml-st-strings.php:308

Component:
Plugin: wpml-string-translation
Time: 0.0519

April 4, 2019 at 2:39 pm #3535903

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi and thank you for sending me all the queries.

I'm currently gathering more information and check things and get back to you here ASAP.

April 4, 2019 at 3:55 pm #3536731

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

When I compared the icl DB tables on your site's copy on our server I could see that for the ICL_TRANSLATIONS table the element_type column type is varchar(36) [post_post] and where as on a clean install it is varchar(60) [post_post]. So here is the query for fixing this.

ALTER TABLE `db-prefix_icl_translations`
CHANGE `element_type` `element_type` varchar(60) COLLATE 'utf8mb4_unicode_520_ci' NOT NULL DEFAULT 'post_post' AFTER `translation_id`;

PLease replace 'db-prefix' with you DB prefix.
I think that after implementing this, the site's performance is improving. At least with what is concerned with WPML.
Could you please implement this fix on your site and see if it helps?

Nevertheless, I'm continuing to check things on our server, and I'll get back to you here.
It would be helpful if you specify here on which pages do you see the slow queries that you have mentioned here in this thread.

Thanks,
Itamar.

April 4, 2019 at 3:56 pm #3536737

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Please take a backup of your DB before implementing the above.

**** Important! Please make a DB backup before you proceed with those steps****

April 4, 2019 at 4:04 pm #3536857

richS-2

Hi Itamar,
thanks very much! I will run the sql query and will keep you informed about the results.

Best
Rich

April 4, 2019 at 4:12 pm #3536913

richS-2

this is the message after running your sql query (translated from german):

"MySQL supplied an empty result back (i.e., null records). (Query took 0.0179 seconds."

Since yesterday I changed a couple of things (cleaning theme files etc). If you want I can send you the actual database for further checks. Maybe better in private message?

April 4, 2019 at 4:43 pm #3537043

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi again.

I've just updated WPML and its add-ins to their latest versions that were released yesterday.
After updating and together with the DB change that I mentioned earlier, I can see that the performance is improving significantly. Do you also see it on your site after those changes?

Regards,
Itamar.

April 4, 2019 at 4:50 pm #3537053

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Regarding this: "MySQL supplied an empty result back (i.e., null records). (Query took 0.0179 seconds."
So I understand that nothing was changed. Is it correct?
When you go to the icl_translations table and look at its structure, do you see varchar(60) or varchar(36)?
Please see the attached screenshot.

April 4, 2019 at 4:53 pm #3537083

richS-2

Hi Itamar,
it feels a little better but I don't know if thats just guessing.
The Shop still suffers from slow queries, here's another example from browsing the blog:

SELECT s.id, st.status, s.domain_name_context_md5 AS ctx , st.value AS translated, st.mo_string AS mo_string, s.value AS original, s.gettext_context
FROM myprefix_icl_strings s
LEFT JOIN myprefix_icl_string_translations st
ON s.id=st.string_id
AND st.language='de'
AND s.language!='de'
WHERE s.context = 'woocommerce'
LIMIT 1000 OFFSET 5000

Caller: WPML_DB_Chunk->retrieve()
Component: Plugin: sitepress-multilingual-cms
Time: 0,0506

Best
Rich

April 4, 2019 at 4:56 pm #3537089

richS-2

when checking the structure of icl_translations table i see varchar(60) in element_type.

edit: yes I think nothing has changed after the sql query.

April 4, 2019 at 5:09 pm #3537195

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Rich, I don't think that 0,0506 would be considered as a slow query.
With every added plugin (and theme) you get more queries to the DB of the site.
It is quite usual to see some performance raise when using WPML.
The question is if it is a significant one.

In the beginning, you have mentioned that when deactivating WPML the performance improves. If this is still the case and improvement in performance is more than a few seconds so there might be some conflict with another plugin or the theme. To check this, please try our minimum environment procedure. Minimum environment means switching to a default WordPress theme like Twentyseventeen and no plugins activated except WPML. You will need first to check if the performance problem persists when just the theme is switched to Twentyseventeen (for example). If it persists then deactivate all plugins except the WPML and its add-ons. Then please check if the problem persists. If it does not persist so start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.

You mentioned this: "Since yesterday I changed a couple of things (cleaning theme files etc). If you want I can send you the actual database for further checks."
If you want you can migrate your site again to our server. It would be in the same process that you did it the first time. The new migration would override the current copy.

Please let me know.
Itamar.

April 8, 2019 at 1:14 pm #3557977

richS-2

Hi Itamar,
sorry for the late response, I've been busy with migration.

I moved the site to live this morning and I still have trouble with the huge CPU-Usage of the Site.

Sure, those mentioned slow queries (see above posts) aren't that slow but still query monitor shows me slow queries from wpml string translations. CPU usage goes up to 100%!!! while browsing the Shop-Page. This is not normal and it's obviously caused by wpml plugin.

The site is still in maintenance mode and I am really scared to open it to the users as I don't know if this will crash the server.

This Plugin costed me 70 € and should not slowdown my website like this. So yes, more Help needed!!

Best
Rich

April 8, 2019 at 2:26 pm #3558875

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, Rich.

You wrote: "...I've been busy with migration."
1. Have you migrated your site again over here to our test server?
hidden link
I ask this because I want to check things on the latest state of your site. I do not want to continue debugging the issue on an old version.

2. According to your last reply, it is not clear to me whether you have tried the minimum environment procedure that I suggested. It might be that WPML is having this issue because of an incompatibility with the theme or another plugin.

Regards,
Itamar.

April 8, 2019 at 3:59 pm #3559957

richS-2

Hi Itamar,

1. I migrated the site from our staging sub domain to the live domain. I haven't migrated anything over to cloudways since last time.

2. I can't test with the mentioned minimum requirements because if I switch to a default theme all my settings (customizer) are gone. Currently I'm using a child theme based on storefront theme.

Before I copy the site again to your server I'd prefer to send you a admin login for the live site which is currently in maintenance mode. Is that ok for you?

Please help! 😉

Best Regards
Rich