Index для Opencart v3 которые помогли снять нагрузку с ЦП

baltun

Администратор
Сообщения
10.872
Реакции
2.584
Баллы
2.003
Делюсь индексами возможно не так оптимизированными с точки зрения базы данных, но тем не менее они помогли снять нагрузку с ЦП которая достигала 4х100% при обмене данными с 1С до банальных 5-10% и при этом сам скорость работы в панели администратора увеличилась в разы с товаром в 5к, да это не большое количество но раньше наблюдались существенные тормоза.
Код:
create index category_filter_id ON oc_category_filter(filter_id);
create index product_filter_id ON oc_product_filter(filter_id);
create index product_filter_pr ON oc_product_filter(filter_id, product_id);
create index product_to_category_id ON oc_product_to_category(product_id);
create index product_to_category_rr ON oc_product_to_category(category_id, main_category);
create index filter_group_inx_id ON oc_filter_description(filter_group_id);
create index language_inx_id ON oc_filter_description(language_id);
create index filter_inx_id ON oc_filter_description(filter_id);
create index name_inx_id ON oc_filter_description(name);
create index nmind_inx ON oc_filter_description (language_id, filter_id, name);
create index nmind_group_inx ON oc_filter_description (language_id, filter_group_id, name);
create index nmind_group_inxx ON oc_filter_description (language_id, name);
create index filter_inx ON oc_filter (filter_id);
create index filter_group_inx ON oc_filter (filter_group_id);
create index filter_group_des ON oc_filter_group_description (language_id, name);
create index filter_group_dess ON oc_filter_group_description (language_id, filter_group_id, name);
create index product_xx ON oc_product(model, sku, product_id, manufacturer_id);
create index product_xi ON oc_product(product_id, price);
create index product_pr ON oc_product(price);
create index product_ii ON oc_product(product_id);
create index product_iаа ON oc_product(sort_order, model, quantity, price, date_added);
create index product_iа ON oc_product(quantity);
create index product_dat ON oc_product(date_added);
create index product_datt ON oc_product(date_available);
create index product_st ON oc_product(status);
create index sr_pr ON oc_product(sort_order);
create index sr_nm ON oc_product(name);
create index weight_pr ON oc_product(weight_class_id);
create index review_ii ON oc_review(product_id);
create index review_gg ON oc_review(status);
create index review_ff ON oc_review(product_id, status, date_added);
create index discount_ii ON oc_product_discount(product_id);
create index discount_iff ON oc_product_discount(customer_group_id, quantity);
create index discount_ife ON oc_product_discount(date_end);
create index translation_xx ON oc_product_discount (date_start);
create index discount_pp ON oc_product_discount (priority, price);
create index special_ii ON oc_product_special(product_id);
create index special_ss ON oc_product_special(customer_group_id, date_start, date_end, priority, price);
create index special_pp ON oc_product_special(priority, price);
create index to_store_ii ON oc_product_to_store(product_id);
create index store_id ON oc_product_to_store(store_id);
create index reward_gg ON oc_product_reward(customer_group_id);
create index reward_ ON oc_product_reward(product_id);
create index image_ii ON oc_product_image(product_id, sort_order);
create index image_ord ON oc_product_image(sort_order);
create index product_description_xi ON oc_product_description(product_id, language_id, name);
create index product_description_ii ON oc_product_description(product_id);
create index product_description_iix ON oc_product_description(name);
create index product_description_iixx ON oc_product_description(language_id);
create index order_xi ON oc_order(order_status_id);
create index attribute_xx ON oc_product_attribute (product_id, attribute_id, language_id);
create index setting_xx ON oc_setting (store_id);
create index setting_xi ON oc_setting (code);
create index attribute_xi ON oc_attribute (attribute_id);
create index attributed_xx ON oc_attribute_description (attribute_id, language_id, name);
create index category_xx ON oc_category (category_id);
create index category_description_xx ON oc_category_description (category_id);
create index to_store_xx ON oc_category_to_store (category_id);
create index translation_xx ON oc_theme (store_id, theme, route);
create index layout_xx ON oc_layout_route (route);
create index layout_xx ON oc_manufacturer (manufacturer_id, name);
create index man_nm ON oc_manufacturer (name);
create index layout_ii ON oc_manufacturer (manufacturer_id);
create index length_tt ON oc_length_class_description (unit, length_class_id, language_id);
create index length_id ON oc_length_class_description (length_class_id);
create index stock_tt ON oc_stock_status (name, stock_status_id, language_id);
create index stock_id ON oc_stock_status (stock_status_id);
create index stock_nn ON oc_stock_status (name);
create index weight ON oc_weight_class_description (unit, weight_class_id, language_id);
create index weight_id ON oc_weight_class_description (weight_class_id);
create index weight ON oc_weight_class (weight_class_id);
create index warehouse_xx ON oc_product_warehouse (product_id, warehouse_id, quantity);
create index warehouse_xi ON oc_product_warehouse (warehouse_id);
create index warehouse_xid ON oc_product_warehouse (product_id);
create index warehouse_xqq ON oc_product_warehouse (quantity);
create index warehouse_ie ON oc_warehouse (warehouse_id, name, sort_order);
create index warehouse_id ON oc_warehouse (warehouse_id);
create index warehouse_ord ON oc_warehouse (sort_order);
create index warehouse_wd ON oc_warehouse_description (warehouse_id, language_id);
create index warehouse_pp ON oc_warehouse_description (param1, param2, param3);
create index warehouse_ppp ON oc_warehouse_description (param4, param5);
create index warehouse_des_id ON oc_warehouse_description (warehouse_id);
create index warehouse_wd ON oc_warehouse_to_store (warehouse_id);
create index to_1c_id ON oc_product_to_1c (1c_id);
create index tax_wd ON oc_tax_rate (tax_rate_id, name, rate);
create index tax_odd ON oc_tax_rate (geo_zone_id);
create index tax_wd ON oc_tax_rule (tax_class_id, priority);
create index tax_yy ON oc_tax_rule (priority);
create index tax_wt ON oc_tax_rule (tax_rate_id);
create index tax_wrr ON oc_tax_rate (tax_rate_id);
create index tax_yy ON oc_tax_rate_to_customer_group (tax_rate_id);
create index cart_uu ON oc_cart (api_id, customer_id, session_id);
create index banner_tt ON oc_banner (banner_id, status);
create index banner_bm ON oc_banner_image (banner_id, language_id, sort_order);
create index banner_lm ON oc_layout_module (layout_id, position, sort_order);
create index information_lm ON oc_information (information_id, status, sort_order);
create index information_lm ON oc_information_description (information_id, language_id, title);
create index information_lm ON oc_information_to_store (information_id, store_id);
create index zone_to_geo_lm ON oc_zone_to_geo_zone (geo_zone_id);
create index session_id ON oc_session (session_id, expire);

Для примера добавить свой индекс можно так:
Код:
ALTER TABLE oc_product ADD INDEX product_xx (model, sku, product_id, manufacturer_id);

Удалить не нужный индекс можно так:
Код:
DROP INDEX product_filter_id ON oc_product_filter;
Индексы не универсальные подойдут для темы Revolution 5.2.1 модуля NeoSeo Обмен с 1C.
 
Последнее редактирование:
Делюсь индексами возможно не так оптимизированными с точки зрения базы данных, но тем не менее они помогли снять нагрузку с ЦП которая достигала 4х100% при обмене данными с 1С до банальных 5-10% и при этом сам скорость работы в панели администратора увеличилась в разы с товаром в 5к, да это не большое количество но раньше наблюдались существенные тормоза.
Код:
create index category_filter_id ON oc_category_filter(filter_id);
create index product_filter_id ON oc_product_filter(filter_id);
create index product_filter_pr ON oc_product_filter(filter_id, product_id);
create index product_to_category_id ON oc_product_to_category(product_id);
create index product_to_category_rr ON oc_product_to_category(category_id, main_category);
create index filter_group_inx_id ON oc_filter_description(filter_group_id);
create index language_inx_id ON oc_filter_description(language_id);
create index filter_inx_id ON oc_filter_description(filter_id);
create index name_inx_id ON oc_filter_description(name);
create index nmind_inx ON oc_filter_description (language_id, filter_id, name);
create index nmind_group_inx ON oc_filter_description (language_id, filter_group_id, name);
create index nmind_group_inxx ON oc_filter_description (language_id, name);
create index filter_inx ON oc_filter (filter_id);
create index filter_group_inx ON oc_filter (filter_group_id);
create index filter_group_des ON oc_filter_group_description (language_id, name);
create index filter_group_dess ON oc_filter_group_description (language_id, filter_group_id, name);
create index product_xx ON oc_product(model, sku, product_id, manufacturer_id);
create index product_xi ON oc_product(product_id, price);
create index product_pr ON oc_product(price);
create index product_ii ON oc_product(product_id);
create index product_iаа ON oc_product(sort_order, model, quantity, price, date_added);
create index product_iа ON oc_product(quantity);
create index product_dat ON oc_product(date_added);
create index product_datt ON oc_product(date_available);
create index product_st ON oc_product(status);
create index sr_pr ON oc_product(sort_order);
create index sr_nm ON oc_product(name);
create index weight_pr ON oc_product(weight_class_id);
create index review_ii ON oc_review(product_id);
create index review_gg ON oc_review(status);
create index review_ff ON oc_review(product_id, status, date_added);
create index discount_ii ON oc_product_discount(product_id);
create index discount_iff ON oc_product_discount(customer_group_id, quantity);
create index discount_ife ON oc_product_discount(date_end);
create index translation_xx ON oc_product_discount (date_start);
create index discount_pp ON oc_product_discount (priority, price);
create index special_ii ON oc_product_special(product_id);
create index special_ss ON oc_product_special(customer_group_id, date_start, date_end, priority, price);
create index special_pp ON oc_product_special(priority, price);
create index to_store_ii ON oc_product_to_store(product_id);
create index store_id ON oc_product_to_store(store_id);
create index reward_gg ON oc_product_reward(customer_group_id);
create index reward_ ON oc_product_reward(product_id);
create index image_ii ON oc_product_image(product_id, sort_order);
create index image_ord ON oc_product_image(sort_order);
create index product_description_xi ON oc_product_description(product_id, language_id, name);
create index product_description_ii ON oc_product_description(product_id);
create index product_description_iix ON oc_product_description(name);
create index product_description_iixx ON oc_product_description(language_id);
create index order_xi ON oc_order(order_status_id);
create index attribute_xx ON oc_product_attribute (product_id, attribute_id, language_id);
create index setting_xx ON oc_setting (store_id);
create index setting_xi ON oc_setting (code);
create index attribute_xi ON oc_attribute (attribute_id);
create index attributed_xx ON oc_attribute_description (attribute_id, language_id, name);
create index category_xx ON oc_category (category_id);
create index category_description_xx ON oc_category_description (category_id);
create index to_store_xx ON oc_category_to_store (category_id);
create index translation_xx ON oc_theme (store_id, theme, route);
create index layout_xx ON oc_layout_route (route);
create index layout_xx ON oc_manufacturer (manufacturer_id, name);
create index man_nm ON oc_manufacturer (name);
create index layout_ii ON oc_manufacturer (manufacturer_id);
create index length_tt ON oc_length_class_description (unit, length_class_id, language_id);
create index length_id ON oc_length_class_description (length_class_id);
create index stock_tt ON oc_stock_status (name, stock_status_id, language_id);
create index stock_id ON oc_stock_status (stock_status_id);
create index stock_nn ON oc_stock_status (name);
create index weight ON oc_weight_class_description (unit, weight_class_id, language_id);
create index weight_id ON oc_weight_class_description (weight_class_id);
create index weight ON oc_weight_class (weight_class_id);
create index warehouse_xx ON oc_product_warehouse (product_id, warehouse_id, quantity);
create index warehouse_xi ON oc_product_warehouse (warehouse_id);
create index warehouse_xid ON oc_product_warehouse (product_id);
create index warehouse_xqq ON oc_product_warehouse (quantity);
create index warehouse_ie ON oc_warehouse (warehouse_id, name, sort_order);
create index warehouse_id ON oc_warehouse (warehouse_id);
create index warehouse_ord ON oc_warehouse (sort_order);
create index warehouse_wd ON oc_warehouse_description (warehouse_id, language_id);
create index warehouse_pp ON oc_warehouse_description (param1, param2, param3);
create index warehouse_ppp ON oc_warehouse_description (param4, param5);
create index warehouse_des_id ON oc_warehouse_description (warehouse_id);
create index warehouse_wd ON oc_warehouse_to_store (warehouse_id);
create index to_1c_id ON oc_product_to_1c (1c_id);
create index tax_wd ON oc_tax_rate (tax_rate_id, name, rate);
create index tax_odd ON oc_tax_rate (geo_zone_id);
create index tax_wd ON oc_tax_rule (tax_class_id, priority);
create index tax_yy ON oc_tax_rule (priority);
create index tax_wt ON oc_tax_rule (tax_rate_id);
create index tax_wrr ON oc_tax_rate (tax_rate_id);
create index tax_yy ON oc_tax_rate_to_customer_group (tax_rate_id);
create index cart_uu ON oc_cart (api_id, customer_id, session_id);
create index banner_tt ON oc_banner (banner_id, status);
create index banner_bm ON oc_banner_image (banner_id, language_id, sort_order);
create index banner_lm ON oc_layout_module (layout_id, position, sort_order);
create index information_lm ON oc_information (information_id, status, sort_order);
create index information_lm ON oc_information_description (information_id, language_id, title);
create index information_lm ON oc_information_to_store (information_id, store_id);
create index zone_to_geo_lm ON oc_zone_to_geo_zone (geo_zone_id);
create index session_id ON oc_session (session_id, expire);

Для примера добавить свой индекс можно так:
Код:
ALTER TABLE oc_product ADD INDEX product_xx (model, sku, product_id, manufacturer_id);

Удалить не нужный индекс можно так:
Код:
DROP INDEX product_filter_id ON oc_product_filter;
Индексы не универсальные подойдут для темы Revolution 5.2.1 модуля NeoSeo Обмен с 1C.
Немного помогло снизить нагрузку, но до 50-ти % примерно во время обмена. Тоже используем модуль от неосео.
Скажите, у Вас сайт работает в какой обвязке php? Apache? CGI? PHP-FPM?
Не могли бы поделиться настройками php, msql, nginx? Также было бы неплохо пообщаться насчёт настроек модуля обмена. К примеру в телеграмме или ватсапе, если конечно не затруднит.
 
Здравствуйте, эта статья изначальная была, используйте данный скрипт InnoDB для Opencart v3 он должен убрать нагрузку ниже 50% я думаю. На сервере используется Nginx + PHP-FPM+mysql v8.
Конфигурационный файл mysql (параметры которые подверглись изменениям) потребление памяти ОЗУ может доходить до 5Гб:
Код:
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
bind-address = 127.0.0.1
expire-logs-days = 10
back-log = 50
innodb-buffer-pool-size = 4294967296
innodb-flush-log-at-trx-commit = 2
innodb-flush-method = O_DIRECT
innodb-log-file-size = 134217728
innodb-open-files = 200000
key-buffer-size = 402653184
max-connections = 300
max-heap-table-size = 33223680
myisam-sort-buffer-size = 31457280
table-open-cache = 100000
thread-cache-size = 128
tmp-table-size = 536870912
wait-timeout = 900
interactive-timeout = 900
innodb-io-capacity = 300
long-query-time = 1

# Восстановление базы данных от 1до 6 выше 4 опасно
#innodb_force_recovery = 3
#innodb_purge_threads = 0

sql-mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
slow-query-log = FALSE
sort-buffer-size = 4194304
innodb-log-buffer-size = 33554432
read-buffer-size = 1048576
read-rnd-buffer-size = 786432
join-buffer-size = 33554432
binlog-cache-size = 262144
general-log = FALSE
innodb-read-io-threads = 12
innodb-write-io-threads = 12
innodb-buffer-pool-instances = 1
Конфиг Nginx:
Код:
    gzip on;
    gzip_comp_level 9;
    gzip_static on;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
    location / {
        rewrite ^/sitemap.xml$ /index.php?route=extension/feed/google_sitemap last;
        rewrite ^/sitemap.xml$ /index.php?route=extension/feed/yandex_sitemap last;
        rewrite ^/googlebase.xml$ /index.php?route=feed/google_base last;
        rewrite ^/system/download/(.*) /index.php?route=error/not_found last;
        if (!-f $request_filename){
            set $rule_3 1$rule_3;
        }
        if (!-d $request_filename){
            set $rule_3 2$rule_3;
        }
        if ($uri !~ ".*\.(ico|gif|jpg|jpeg|png|js|css)"){
             set $rule_3 3$rule_3;
        }
        if ($rule_3 = "321"){
            rewrite ^/([^?]*) /index.php?_route_=$1 last;
        }
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location ~* ^.+\.(jpg|jpeg|gif|png|webp|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|woff2)$ {
            expires max;
            add_header Cache-Control public;
            access_log off;
    }
    location /admin {
        allow 192.168.1.0/24;
        deny all;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location @php {
        fastcgi_param PHP_VALUE "
        max_input_vars = 30000
        upload_max_filesize = 999M";
        fastcgi_buffers 64 64k;
        fastcgi_buffer_size 128k;
        fastcgi_send_timeout 2000;
        fastcgi_read_timeout 2000;
    }
Если хотите обмениваться через IP адрес в локальной сети, тогда нужно дописать это:
Код:
    location /export/neoseo_exchange1c.php {
        proxy_pass http://192.168.1.100/export/neoseo_exchange1c.php;
    }
Конфиг PHP-FPM (тут понимаете все зависит от нагрузки и памяти ОЗУ):
Код:
pm = dynamic
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_children = 500
pm.max_spare_servers = 20
По модулю могу прислать скриншоты как настроен. Хотите заведите вопрос в ТП возможно у кого то больше опыта есть и люди поделятся я давно его настраивал и он уже несколько лет сам работает по себе ))
 
Здравствуйте, эта статья изначальная была, используйте данный скрипт InnoDB для Opencart v3 он должен убрать нагрузку ниже 50% я думаю. На сервере используется Nginx + PHP-FPM+mysql v8.
Конфигурационный файл mysql (параметры которые подверглись изменениям) потребление памяти ОЗУ может доходить до 5Гб:
Код:
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
bind-address = 127.0.0.1
expire-logs-days = 10
back-log = 50
innodb-buffer-pool-size = 4294967296
innodb-flush-log-at-trx-commit = 2
innodb-flush-method = O_DIRECT
innodb-log-file-size = 134217728
innodb-open-files = 200000
key-buffer-size = 402653184
max-connections = 300
max-heap-table-size = 33223680
myisam-sort-buffer-size = 31457280
table-open-cache = 100000
thread-cache-size = 128
tmp-table-size = 536870912
wait-timeout = 900
interactive-timeout = 900
innodb-io-capacity = 300
long-query-time = 1

# Восстановление базы данных от 1до 6 выше 4 опасно
#innodb_force_recovery = 3
#innodb_purge_threads = 0

sql-mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
slow-query-log = FALSE
sort-buffer-size = 4194304
innodb-log-buffer-size = 33554432
read-buffer-size = 1048576
read-rnd-buffer-size = 786432
join-buffer-size = 33554432
binlog-cache-size = 262144
general-log = FALSE
innodb-read-io-threads = 12
innodb-write-io-threads = 12
innodb-buffer-pool-instances = 1
Конфиг Nginx:
Код:
    gzip on;
    gzip_comp_level 9;
    gzip_static on;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
    location / {
        rewrite ^/sitemap.xml$ /index.php?route=extension/feed/google_sitemap last;
        rewrite ^/sitemap.xml$ /index.php?route=extension/feed/yandex_sitemap last;
        rewrite ^/googlebase.xml$ /index.php?route=feed/google_base last;
        rewrite ^/system/download/(.*) /index.php?route=error/not_found last;
        if (!-f $request_filename){
            set $rule_3 1$rule_3;
        }
        if (!-d $request_filename){
            set $rule_3 2$rule_3;
        }
        if ($uri !~ ".*\.(ico|gif|jpg|jpeg|png|js|css)"){
             set $rule_3 3$rule_3;
        }
        if ($rule_3 = "321"){
            rewrite ^/([^?]*) /index.php?_route_=$1 last;
        }
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location ~* ^.+\.(jpg|jpeg|gif|png|webp|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|woff2)$ {
            expires max;
            add_header Cache-Control public;
            access_log off;
    }
    location /admin {
        allow 192.168.1.0/24;
        deny all;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location @php {
        fastcgi_param PHP_VALUE "
        max_input_vars = 30000
        upload_max_filesize = 999M";
        fastcgi_buffers 64 64k;
        fastcgi_buffer_size 128k;
        fastcgi_send_timeout 2000;
        fastcgi_read_timeout 2000;
    }
Если хотите обмениваться через IP адрес в локальной сети, тогда нужно дописать это:
Код:
    location /export/neoseo_exchange1c.php {
        proxy_pass http://192.168.1.100/export/neoseo_exchange1c.php;
    }
Конфиг PHP-FPM (тут понимаете все зависит от нагрузки и памяти ОЗУ):
Код:
pm = dynamic
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_children = 500
pm.max_spare_servers = 20
По модулю могу прислать скриншоты как настроен.
Спасибо, посмотрю. Получается лучше перевести в innodb.
Если не сложно по скриншотам модуля - буду благодарен, сравню со своими настройками.
мой nginx:
server {
    server_name domain.ru;
    index index.php;
    listen IP:443 ssl  http2 ;

    ssl_certificate "/***.crt";
    ssl_certificate_key "/***.key";
    add_header Strict-Transport-Security "max-age=31536000" always;

    charset utf-8;

    gzip on;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/css text/xml application/javascript text/plain application/json image/svg+xml image/x-icon;
    gzip_comp_level 5;

    set $subdomain "";
    if ($host ~* ^([a-z0-9-\.]+)\.domain.ru) {
        set $subdomain $1;
    }
    if ($host ~* ^www.domain.ru) {
        set $subdomain "";
    }
    
    set $root_path /domain.ru/$subdomain;
    

    root $root_path;
    disable_symlinks if_not_owner from=$root_path;

    location ~* \/\.ht {
        deny all;
    }

    location ~* \.(log|tpl|txt|twig|xml|ini)$ {
        deny all;
    }

    location ~* \/\.git {
        deny all;
    }

    location ~* \/image.+(\.php) {
        deny all;
    }

    location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|webp|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
        expires max;
        etag on;
        log_not_found off;
    }

    location = /sitemap.xml {
        allow all;
        rewrite ^(.*)$ /index.php?route=extension/feed/google_sitemap last;
        rewrite ^(.*)$ /index.php?route=extension/feed/yandex_sitemap last;
    }

    location = /googlebase.xml {
        allow all;
        rewrite ^(.*)$ /index.php?route=extension/feed/google_base last;
    }

    location /system {
        rewrite ^/system/storage/(.*) /index.php?route=error/not_found last;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location /admin { index index.php; }

    location / {
        try_files $uri @opencart;
    }

    location @opencart {
        rewrite ^/(.+)$ /index.php?_route_=$1 last;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/domain.ru.sock;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_read_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_connect_timeout 600;
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        send_timeout 600;
        fastcgi_param    PHP_VALUE    "memory_limit = 1024M";
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }


opcache.blacklist_filename=/opt/opcache-blacklists/opcache-*.blacklist
short_open_tag=On
session.save_path=/tmp
mail.add_x_header=On
sendmail_path=/usr/sbin/sendmail -t -i -f 'admin@domain.ru'
log_errors=On
max_input_vars=10000
max_execution_time=120
output_buffering=4096
display_errors=off
post_max_size=100M
opcache.max_accelerated_files=100000
upload_max_filesize=100M
date.timezone=Europe/
upload_tmp_dir=/tmp
 
Спасибо, посмотрю. Получается лучше перевести в innodb.
Это в большей степени по желанию, но насколько я изучал и визуально в скорости прибавило, но нагрузку сняло не innodb, а индексация базы данных, скрипт делает все это, закидываете его в корень магазина и переходите название его уже и не помню, первое действие перевод БД в innodb, второе действие индексация БД, на всякий случай перед скриптом сделайте бэкап, я конечно им пользовался много раз и проблем не было, но на всякий случай. У меня в магазине товара более 8к проблем не было и про нагрузку на сервере забыл. И да если товара много интеграция может не отрабатывать будут ошибки в php, что памяти не хватает, в моем случае я выставил 4096 мб для работы, по факту чуть больше 3гб потребляет интеграция.
 
Это в большей степени по желанию, но насколько я изучал и визуально в скорости прибавило, но нагрузку сняло не innodb, а индексация базы данных, скрипт делает все это, закидываете его в корень магазина и переходите название его уже и не помню, первое действие перевод БД в innodb, второе действие индексация БД, на всякий случай перед скриптом сделайте бэкап, я конечно им пользовался много раз и проблем не было, но на всякий случай. У меня в магазине товара более 8к проблем не было и про нагрузку на сервере забыл. И да если товара много интеграция может не отрабатывать будут ошибки в php, что памяти не хватает, в моем случае я выставил 4096 мб для работы, по факту чуть больше 3гб потребляет интеграция.
Товара примерно 30к, памяти на VDS 4гб. Попробую перевести базу, может поможет.
 
Товара примерно 30к, памяти на VDS 4гб. Попробую перевести базу, может поможет.
Нагрузку вы снимете, но вот для корректной работы сугубо мое мнение требуется 16ГБ минимум для такого объема я боюсь, что только php у вас может забрать более 8Гб и конечно SSD обязательно должно быть.
 
Нагрузку вы снимете, но вот для корректной работы сугубо мое мнение требуется 16ГБ минимум для такого объема я боюсь, что только php у вас может забрать более 8Гб и конечно SSD обязательно должно быть.
Раньше вообще работало на простом хостинге c hdd и apache. И работало ))) Пусть медленно, но всё же. Ввиду высокой нагрузки - пришлось переехать на VDS. Сейчас работает быстрее гораздо. Есть конечно моменты - но это от настроек, которые я не умею делать. Вот так по форумам собираю, анализирую и смотрю примерно лучшие.

Сейчас, при так скажем простое, у меня загрузка ЦП - 3-5%, память - 1015.21 Мб из 3.70 Гб. По статистике, память использовалась не более 1200 мб. Т.е. всю не пожирало.
 
Назад
Верх Низ