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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by George Botsev 1 year ago.

Assigned support staff: George Botsev.

Author Posts
October 7, 2018 at 6:51 pm

Иван Самохин

I am trying to: all performance recommendations on your Documentation

Link to a page where the issue can be seen: hidden link

Good afternoon. Slowly the admin panel and site opens on the hosting and on the local computer. I am developing a new wordpress multisite. Content a couple of pages and one product. Theme is flatsome. Languages included a lot.
Turning off and turning on your plugins speeds up work, but not for long.
MYSQL: 5.6.25-73.1 - Percona Server (GPL), Release 73.1, Revision 07b797f
PHP: 7.0.24
The slowest query found:
Time: 36.3ms (0.036318063735962s)
• Query:
SELECT t.translation_id, t.element_id, t.language_code, t.source_language_code, t.trid, t.element_type FROM wpgid_icl_translations t JOIN wpgid_posts p ON t.element_id = p.ID AND t.element_type = CONCAT('post_', p.post_type) JOIN wpgid_icl_translations tridt ON tridt.element_type = t.element_type AND tridt.trid = t.trid WHERE tridt.trid = (SELECT trid FROM wpgid_icl_translations t JOIN wpgid_posts p ON t.element_id = p.ID AND t.element_type = CONCAT('post_', p.post_type) WHERE element_id = 62 LIMIT 1)
Here is the loading time information:
hidden link
At the end of the file you can see the size of your tables. Is this the normal size for a new site?

define('WP_DEBUG', true);
define('SAVEQUERIES', true);

duplicator not work in wordpress multisite.

or:
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 wpgid_icl_strings s
LEFT JOIN wpgid_icl_string_translations st
ON s.id=st.string_id
AND st.language='ru'
AND s.language!='ru'
WHERE s.context = 'wpcf'
LIMIT 1000 OFFSET 0

see attach image

October 8, 2018 at 9:29 am #2795285

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Hello and thank you for contacting us.

Let me first answer your question about the table size.
The table size for string translation depends on the number of plugins that you have and the number of languages that you have activated on your site.
In a multisite environment the tables for strings does not share data between the subsites -so if you have two sub-sites with the same plugins and same languages active, then you will have two string translation tables with the same size.

For the performance issues that you encounter - I think you started to debug that very nicely and found out this:

Turning off and turning on your plugins speeds up work, but not for long.

This means that there is a cache of all of the strings that is being emptied and then it is being gradually filled-up again.
That alone tells me the following:
- The server that you are using perhaps is a low specs server / shared hosting and it has its limits.
- You are not using object cache.
It is recommended to use object cache for such scenarios, as then the speed is improved significantly.

In your initial reply you say that you have applied all the recommendations that we suggest, but I implore you to take a look here: https://wpml.org/faq/prevent-performance-issues-with-wpml/#optimizing-wpml-performance and check if the settings match your setup and apply them accordingly.
For the backend - if you are just developing the site, you might want to try to switch your user language to English - as this could speed up the process even if you are not using object cache.

October 8, 2018 at 10:37 pm #2797491

Иван Самохин

Hi, George. Thanks for the support.
1) How to reduce the contents of these tables? Removing, disabling plug-ins is not affected. How to disable their replenishment? I just used the translation of the site name in the plugin "String Translation", if I do not need to translate the remaining strings?

2) "This means that there is a cache of all of the strings that is being emptied and then it is being gradually filled-up again."
What kind of cache? Where to watch this overflow? Cache
embedded in WPML? I thought caching speeds up the work.
3) "The server that you are using perhaps is a low specs server / shared hosting and it has its limits."
Memory Limit 268435456
Memory Usage 42.27 MB
Max. lead time 60
Max. entrance. variables 10,000
Multibyte String Extension Loaded
SimpleXML extension uploaded
Memory Limit 128M
Maximum memory limit 256M
Declared use of SSD disks

How can I understand that the bottleneck is hosting?
4) "You are not using object cache". I use W3 total cache:
Object Cache: enabled
Object Cache Method: disk
See attach image.

5) "switch your user language to English"
Switch the default language in WPML to English or just change the site language to English? in English, anyway, slow queries to the tables:

FROM wpgid_5_icl_string_pages sp
INNER JOIN wpgid_5_icl_string_urls su

or

FROM wpgid_icl_translations t JOIN wpgid_posts p

or
FROM wpgid_8_icl_string_pages sp
INNER JOIN wpgid_8_icl_string_urls su

October 10, 2018 at 8:06 am #2803294

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Hello @otdryzeimail-ru
Thank you for your detailed answer.
I will try to respond to all of your question to the best of my abilitied, but if you have more questions - don't hesitate to ask me.

How to reduce the contents of the string tables -> usually this can be done with these steps:
-Remove unnecessary plugins
-Remove the strings from WPML > String Translation that are registered from that plugin / text domain

If you have the plugins in use, they will be scanned once they are used and the strings that are used will be added to the tables.

2. WPML and WPML String Translation caches the strings for faster retrieval. That process is usually transparent to the user and visible only for the system.
Yes, caching can speed-up things usually, unless there is not enough memory for the cache - so that the cache process actually never finishes and flushes old data. I suspect that this is what happens in your case.

3. Yes, your server appears to be a very good server.

4. About Object cache - the method "disk" in W3TC is not very good method to cache, and sometimes is actually known to cause performance issues.
By object cache, I was refering to a true object cache - like Memcache / Memcached implementation - which is another service that runs in the RAM of the server and provides a decent boost.

5. If you switch the site language to English, and then go to WPML > Theme and plugin localization and enable the option "Assume all strings original language is English" and your user profile language is English, then you should notice a good boost in the performance.

the tables string_pages and string_urls are directly responsible for the cached strings. They help cache the strings per page - so that only the needed strings are loaded and not all of them.

From what I see, you have a multisite environment and the issues happen for site with ID 5 and ID 8.
I suggest that you try and disable W3TC disk cache and talk with your hosting provider about enabling memcache / memcached server so that you can trully benefit from object caching.

The topic ‘[Closed] performance issues’ is closed to new replies.