What is the best method to eliminate the effect of Magento using 20,000+ products

I am running magento on 3 instances of Amazon EC2. One of them is configured for access directly to the admin panel, the other two are sitting at the load balancer.

Everything worked smoothly until we imported our data with 20k + products, each of which is configured with ~ 4 simple products (for different sizes, colors, etc.).

The only thing that works slowly seems to be the things that iterate over the products - both the pages of the admin directory and frontend take 5-10 + seconds to get a response from the server. Static / CMS pages load fine.

They are all connected to the same MySQL RDS database, which works fine - I can make queries and quickly return them.

We turned on all caching (including full-screen cache) and turned on flat directories without real speed changes.

The magento directories are independent for each server, with the exception of the directory media/that is kept in sync with lsyncd. The administration server behaves as the main one, and two servers balanced on the external front are subordinate devices.

+4
source share
3 answers

Let's break it down:

  • Assumptions I'll make (please check them out)

    • You are using fairly powerful instances of EC2, for example m3.large
    • You are using a PHP cache such as APC
    • You are using the Magento compiler -> tools-> compilation
    • - Apache
    • " 5 10 , " CSS JS .
    • ( , . , )
    • - "keep alives" "expires headers".

- , , , 5 10 , .

-, , . Apache , Magento (Mage.php), . , , "" 0,25 , 0,1 .

, . , , , , , , - , .

, 20000 ( 100 000? = 20 000 + 4 * 20 000 ), , , , URL / .


  1. .phtml

Mage::getModel(catalog/product)->load($_product->getId())

, , . ->load(), , . , , (, , ).


  1. core_url_rewrite

, - , . . , , , Magento Admin - , , (Magento, , ). Magento, , .

. core_url_rewrite , .phtml, , , . , , , .


  1. Varien

, , magento. , , . , , Varien . , ( , , , , , , ).


  1. : " MySQL - ".

, . , , phpmyadmin, , my.cnf. phpmyadmin- > status- > innodb_buffer_pool key_buffer_size table_cache. , Magento , mysql . , innodb, , ( ), ibdata1 innodb , , , , , 'innodb_file_per_table'. innodb_file_format=Barracuda, , , .

fooobar.com/questions/14797/.... : , innodb Magento, , , .

, my.cnf ( , , :).

max_allowed_packet =  
table_cache =  
sort_buffer_size =   
read_buffer_size =   
read_rnd_buffer_size =   
myisam_sort_buffer_size =   
tmp_table_size =   
max_heap_table_size =  
query_cache_size =  
query_cache_type =  
thread_cache_size =  

innodb_fast_shutdown = 0  
innodb_file_per_table  
innodb_buffer_pool_size =  
innodb_additional_mem_pool_size =  
innodb_log_file_size =  
innodb_log_buffer_size =  
innodb_flush_log_at_trx_commit =  
innodb_lock_wait_timeout =  
innodb_thread_concurrency =  
skip-external-locking  
max_connections =  
read_buffer_size =  
sort_buffer_size =  
key_buffer_size =

  1. SSH

'top', http- mysql - , . , , httpd.conf my.cnf CPU . , , , ...

top , , CPU - script kiddie.


M3 , Percona , ramdisk, - Facebook, Magento HHVM, " " Magento, . ...

----------

, , . , Magento . , , .

, , , , .

+7

Try the extended full page cache . It is very good

0
source

Source: https://habr.com/ru/post/1533038/


All Articles