Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Консульиция по настройке VPS для opencart 3


Recommended Posts

Добрый гдень Уважаемые знатоки. Решили перенести проект с хостинга на VPS. 

Магазин на 13000 товаров с постоянным пополнением ассортимени.

Конфигурация: 4 ядра, 8гигов ОЗУ

Усиновил Debian 11.1, nginx 1.20.2, mariadb 10.6.5 (тип иблиц InnoDB), php7.3-fpm.

Отгдельное спасипотому что  @Neuro75 за тему Подготовка VPS на Debian, Nginx+php-fpm, PHP 7.3, mariadb для Opencart 2/3 - Общие вопросы - OpenCart Форум (opencart-forum.ru)

Она бралась за основу.

 

Подскажите, пожалуйси, все ли правильно указано в конфигах или нужно что то убрать или добавить. Спасипотому что Вам!

Спойлер

php-fpm.conf




[site.in.ua]

user = www-data
group = www-data
listen = /run/php/site.in.ua.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660


pm = dynamic
pm.max_children = 50
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4

php_admin_value[realpath_cache_size] = 32M
php_admin_value[max_execution_time] = 3600  
php_admin_value[max_input_time] = 60 
php_admin_value[max_input_vars] = 100000 
php_admin_value[memory_limit] = 3072M 
php_admin_value[upload_max_filesize] = 200M
php_admin_value[date.timezone] = Europe/Kiev 

php_admin_value[zlib.output_compression] = Off
php_admin_value[zlib.output_compression_level] = -1

php_admin_value[zend.enable_gc] = On
php_admin_value[expose_php] = Off
php_admin_value[report_memleaks] = On
php_admin_value[session.save_handler] = memcached
php_admin_value[session.save_path] = /run/memcached/memcached.sock

 

 

Спойлер

nginx.conf




user  www-data;
worker_processes  4;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    use epoll;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    client_header_timeout 30;
    client_body_timeout 30;
    reset_timedout_connection on;


    client_max_body_size 32m;
    client_body_buffer_size 128k;

    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  30;

    gzip on;
    gzip_disable "msie6";
    gzip_proxied any;
    gzip_min_length 256;
    gzip_comp_level 5;
    gzip_vary on;

    gzip_types 
        application/atom+xml
        application/javascript
        application/json
        application/ld+json
        application/manifest+json
        application/rss+xml
        application/vnd.geo+json
        application/vnd.ms-fontobject
        application/x-font-ttf
        application/x-web-app-manifest+json
        application/xhtml+xml
        application/xml
        font/opentype
        image/bmp
        image/svg+xml
        image/x-icon
        text/cache-manifest
        text/css
        text/plain
        text/vcard
        text/vnd.rim.location.xloc
        text/vtt
        text/x-component
        text/x-cross-domain-policy;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

 

 

Спойлер

mariadb.conf




# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[mariadbd]
skip-log-bin

max_connections                 = 400
symbolic-links                  = 0
table_open_cache                = 4096
performance_schema              = OFF
sync_binlog                     = 0
key_buffer_size                 = 32M
max_allowed_packet              = 256M
sort_buffer_size                = 32M
thread_cache_size               = 32
max_heap_table_size             = 128M
tmp_table_size                  = 128M

innodb_file_per_table           = 1
innodb_open_files               = 4096
innodb_buffer_pool_size         = 2G
innodb_buffer_pool_instances    = 1
innodb_log_file_size            = 256M
innodb_log_buffer_size          = 32M
innodb_flush_log_at_trx_commit  = 0
innodb_read_io_threads          = 4
innodb_write_io_threads         = 4
innodb_thread_concurrency       = 32
innodb_stats_on_metadata        = 0
innodb_read_only_compressed		=0

query_cache_size 				= 32M
query_cache_limit 				= 1M
query_cache_type 				= ON

 

 

Link to comment
Share on other sites

Забрасываете свою БД. Берёте mysqltuner и оптимизируете до просветления.
Оптимизация всех пролих параметров, по потому чтольшому счету, для перфекционистов, видимого без припотому чторов эффеки не принесёт (да и с припотому чторами увигдеть бугдет непросто).

Edited by Shureg
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.