E
E
Evgeny Nikolaev2019-07-09 10:36:47
1C-Bitrix
Evgeny Nikolaev, 2019-07-09 10:36:47

Smart filter(smart.filter)bitrix in the online store. catalog.section freezes when filtering by 2 properties. Why?

5d2441645fc65147198437.jpeg
Next situation. It was necessary that the smart filter could offer to mark several items with checkboxes for each filtered property (now it is filtered by the properties of trade offers), we did the following: we rewrote the template so that the properties by which filtering is sent in an array. Well, for example, there is a SIZE property - size and TYPE - type, well, for example, the sizes are 100 * 100, 100 * 150, and the type is 1 pillowcase, 2 pillowcases and TP. Thus, the ajax filter sends a request of the form controler?SIZE[]=100*100&SIZE[]=100*150&TYPE[]=2 on the fly, this request goes to a php script in which the data received via GET is parsed and transferred to catalog.section as an array name which is specified in FILTER NAME.
So if you transfer data from only one property (it doesn’t matter if 1,2,3 or more values ​​​​are selected) - everything is fine, but if you transfer data immediately with SIZE and TYPE, the hapros hung up, and the whole site stopped responding for 1-3 minutes, issuing pages error 500. What you see on the screen is the work of another hosting.
So, we decided to change the hosting, a request for one property is processed in 0.5 seconds on average, but the first requests for 2 or more properties simultaneously suspended the request for 12 seconds (maximum), and so 4-8 seconds, then they started working faster.
I understand that if it were a large online store, we have 500 products, so why would a search in catalog.section by 2 properties instead of one suddenly start to be processed longer up to 10 times or more?
Related questions:
1) maybe someone came across, there are options what we are doing wrong? But in fact, we checked the var_dump array (the one that is passed as a filter to catalog.section) well, everything is very simple and standard, the most common array for filtering, why such an effect?
2) why does the second hosting even work in 12 seconds and does not hang, while the first one hangs for 1-3 minutes? What parameters to look at in php, apache, mysql maybe there are not enough resources or the number of allowed operations per session?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question