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

Too slow #321

Closed
cizgidekiadam opened this issue Feb 1, 2017 · 11 comments
Closed

Too slow #321

cizgidekiadam opened this issue Feb 1, 2017 · 11 comments

Comments

@cizgidekiadam
Copy link

Magento version : 2.1.2
Module version : smile/elasticsuite 2.4.x-dev

It takes too much time while searching.
Even decrease searchable attributes to 4.

Full reindex completed. Everything working fine except search.

It takes about ~2mins with 50-60 items returned.
How can i do it faster ?

@romainruaud
Copy link
Collaborator

Hello @rbostan ,

We never seen such delay. Even with our big test catalog which features 3M of configurable products.

Are you sure that Smile ElasticSuite is selected as the search engine in the configuration ?

@cizgidekiadam
Copy link
Author

@romainruaud Yes, it is selected.
All caches cleared and indexers completed their jobs.

I didn't find any solution for this :(
And project deadline comes close.

If there is a private channel to contact Smile, I can give website url, admin url, even ssh acces to solve this issue.

Is Smile serving consulting about like these issues ?

@romainruaud
Copy link
Collaborator

Hello @rbostan, is the category navigation as slow as the search ?

Do you have third party modules installed ?

@cizgidekiadam
Copy link
Author

@romainruaud
While cache enabled, category listing pages, product view pages, cms pages etc.. very fast
(approx 1.5 sec)

We are using a premium theme and it has some modules but not any of them related with search backend. They are focusing on theme options.

I have disabled that modules, changed theme to Luma but no result. Still too slow

@cizgidekiadam
Copy link
Author

@romainruaud
Is that issue related about ES configuration?

Installed ES via yum and nothing changed about configuration. Just installed. May be ?

@romainruaud
Copy link
Collaborator

Hello @rbostan , I do not think this could be a configuration issue.

Can you activate the Magento profiler and give me insight about what piece of code is taking time on your pages ?

You should see a line with "ES:Execute Search Query" which monitor the execution time of the query to ES.

Can you please also post your server configuration : CPUs, RAM, etc ... and which memory_limit you are using for PHP ?

Regards,

@cizgidekiadam
Copy link
Author

@romainruaud
You may find profiler output for a catalogsearch result page.
profiler.zip

Server structures :

Web Server
Centos 7.2 (Nginx, PHP 7.0.14 FPM, REDIS)
Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz 8 core
32 GB RAM

Database Server
Centos 7.2 no LAMP or extra services
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz 8 Core
32GB Ram
SSD Disk

PHP
memory_limit=12G
max_execution_time = 0 (no limit)

@romainruaud
Copy link
Collaborator

So the query processing by ES took 0.04 secs so this is not your bottleneck.

But the rendering of the Magento_Catalog/templates/product/list.phtml seems very suspicious with a rendering time of ~20secs.

For me, this is not related to ElasticSuite module but elsewhere, when Magento process to the loading of the products displayed in the page.

How are your mysql settings ? especially the innodb_buffer_pool_size ? You may set a value between 16Gb and 24Gb for this one regarding your server specs. Maybe check your slow query log too.

Are you sure that you are in production mode also ?

Best regards,

@cizgidekiadam
Copy link
Author

@romainruaud
Switched to default theme to check list.phtml, clean caches, set mode to production.
No changes. Still it takes min ~30-40 secs even repeated searches.

Database parameters like below:

[mysql]

# CLIENT #
port                           = 3306
socket                         = /var/lib/mysql/mysql.sock

[mysqld]

# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock

# MyISAM #
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP

# SAFETY #
max-allowed-packet             = 128M
max-connect-errors             = 1000000
skip-name-resolve
sysdate-is-now                 = 1

# DATA STORAGE #
datadir                        = /var/lib/mysql/
# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1
binlog-format		       = ROW
binlog_cache_size	       = 16M
# CACHES AND LIMITS #
tmp-table-size                 = 512M
max-heap-table-size            = 512M
query-cache-type=0
query-cache-limit = 4M
query-cache-min_res_unit = 4K
query-cache-size = 1G
query-cache-strip-comments =1
max-connections                = 500
thread-cache-size              = 100
open-files-limit               = 65535
table-definition-cache         = 4096
table-open-cache               = 40000

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 6G
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 24G
innodb-log-buffer-size	       = 128M
innodb-buffer-pool-instances   = 24
# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
#log-queries-not-using-indexes
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log
long-query-time = 5
join-buffer-size	       =32M

@cizgidekiadam
Copy link
Author

Finally found the source of issue.

We have configurables with ~400 children. In price block, code is trying to find lowest price value for show in product list. It takes too much time for this.

Now, i'm trying to find a short way to do this.

I know this is not about Elasticsuite but do you know a faster way to find lowest price ?
If you don't you may close this issue.

Apologies, took your time for unrelated problem. It is my bad.

@afoucret
Copy link
Contributor

afoucret commented Feb 6, 2017

Since the issue is not related to ElasticSuite, I close the issue.
Maybe can you try to dig this PR magento/magento2#90 on Magento repo

@afoucret afoucret closed this as completed Feb 6, 2017
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

3 participants