Привет всем, надеюсь на помощь профессионалов, многого еще не знаю, но самостоятельно решить проблему не получается, пытаюсь долгое время разобраться в медленной работе сайта, а именно: долгом ответе сервера из-за работы Mysql, /usr/sbin/mysqld грузит оперативной памяти 30-50%, сервер отвечает по тестам 6-15 секунд, после грузится остальное уже быстро.
Имеется виртуальный сервер на Xeon 2*2.50GHz, 1 гб ОЗУ, стоит ubuntu 16.04.3, PHP 7.0.8, MySQL 5.7.16. Сайт на wordpress в режиме FastCGI (Nginx + PHP-FPM). Процессор грузится не более чем на 10%, посетителей в день 150-400. Грешу на не правильную настройку Mysql, могу ошибаться конечно, поэтому отправляю все конфиги, где я изменял значения по умолчанию: /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address 127.0.0.1
expire-logs-days 10
innodb-buffer-pool-size 270мб
innodb-flush-method O_DIRECT
innodb-log-file-size 68мб
interactive-timeout 300
key-buffer-size 16мб
local-infile FALSE
max-allowed-packet 16мб
max-binlog-size 100мб
max-connections 151
max-connect-errors 1000
max-join-size 1000000
max_heap_table_size 96мб
myisam-recover-options BACKUP
pid-file /var/run/mysqld/mysqld.pid
query-cache-size 32мб
read_buffer_size 128кб
symbolic-links FALSE
table-definition-cache 2000
tmp_table_size 96мб
thread-cache-size 8
thread-stack 196608
wait-timeout 300
MySQLTuner
[!!] Overall possible memory usage with other process exceeded memory
[!!] Aborted connections: 7.14% (1/14)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Temporary tables created on disk: 33% (55 on disk / 163 total)
[!!] Key buffer used: 18.2% (3M used / 16M cache)
[!!] Read Key buffer hit rate: 50.0% (6 cached / 3 reads)
Reduce or eliminate unclosed connections and network issues
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Variables to adjust:
tmp_table_size (> 96M)
max_heap_table_size (> 96M)
/var/log/mysql error.log
2016-11-13T20:46:39.341249Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2016-11-13T20:46:39.341406Z 0 [Note] Binlog end
2016-11-13T20:46:39.341844Z 0 [Note] Shutting down plugin 'auth_socket'
2016-11-13T20:46:39.341869Z 0 [Note] Shutting down plugin 'ngram'
2016-11-13T20:46:39.341880Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-11-13T20:46:39.341889Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-11-13T20:46:39.341900Z 0 [Note] Shutting down plugin 'partition'
2016-11-13T20:46:39.341912Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-11-13T20:46:39.341981Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-11-13T20:46:39.341995Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-11-13T20:46:39.342005Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-11-13T20:46:39.342015Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-11-13T20:46:39.342025Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-11-13T20:46:39.342032Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-11-13T20:46:39.342036Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-11-13T20:46:39.342041Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-11-13T20:46:39.342046Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-11-13T20:46:39.342051Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-11-13T20:46:39.342055Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-11-13T20:46:39.342060Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-11-13T20:46:39.342065Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-11-13T20:46:39.342069Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-11-13T20:46:39.342074Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-11-13T20:46:39.342078Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-11-13T20:46:39.342083Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-11-13T20:46:39.342088Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-11-13T20:46:39.342092Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-11-13T20:46:39.342097Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-11-13T20:46:39.342101Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-11-13T20:46:39.342106Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-11-13T20:46:39.342111Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-11-13T20:46:39.342115Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-11-13T20:46:39.342120Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-11-13T20:46:39.342125Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-11-13T20:46:39.342130Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-11-13T20:46:39.342134Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-11-13T20:46:39.342139Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-11-13T20:46:39.342143Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-11-13T20:46:39.342148Z 0 [Note] Shutting down plugin 'InnoDB'
2016-11-13T20:46:39.342260Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-11-13T20:46:39.342400Z 0 [Note] InnoDB: Starting shutdown...
2016-11-13T20:46:39.442585Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-11-13T20:46:39.443172Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 161113 23:46:39
2016-11-13T20:46:40.466838Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1141956924
2016-11-13T20:46:40.471227Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-11-13T20:46:40.471246Z 0 [Note] Shutting down plugin 'CSV'
2016-11-13T20:46:40.471255Z 0 [Note] Shutting down plugin 'MyISAM'
2016-11-13T20:46:40.471275Z 0 [Note] Shutting down plugin 'MEMORY'
2016-11-13T20:46:40.471290Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-11-13T20:46:40.471301Z 0 [Note] Shutting down plugin 'sha256_password'
2016-11-13T20:46:40.471306Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-11-13T20:46:40.471533Z 0 [Note] Shutting down plugin 'binlog'
2016-11-13T20:46:40.472118Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2016-11-13T20:46:40.718056Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-13T20:46:40.719750Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.16-0ubuntu0.16.04.1) starting as process 9852 ...
2016-11-13T20:46:40.724749Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-11-13T20:46:40.724787Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-11-13T20:46:40.724795Z 0 [Note] InnoDB: Uses event mutexes
2016-11-13T20:46:40.724801Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-11-13T20:46:40.724808Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-11-13T20:46:40.724814Z 0 [Note] InnoDB: Using Linux native AIO
2016-11-13T20:46:40.725110Z 0 [Note] InnoDB: Number of pools: 1
2016-11-13T20:46:40.725235Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-11-13T20:46:40.726915Z 0 [Note] InnoDB: Initializing buffer pool, total size = 384M, instances = 1, chunk size = 128M
2016-11-13T20:46:40.754858Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-11-13T20:46:40.760159Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-11-13T20:46:40.773092Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-11-13T20:46:40.799094Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-11-13T20:46:40.799210Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-11-13T20:46:40.824585Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-11-13T20:46:40.826613Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-11-13T20:46:40.826647Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-11-13T20:46:40.827246Z 0 [Note] InnoDB: Waiting for purge to start
2016-11-13T20:46:40.877981Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-11-13T20:46:40.882895Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-11-13T20:46:40.886109Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-11-13T20:46:41.890806Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161113 23:46:41
2016-11-13T21:16:30.334636Z 0 [Note] Giving 1 client threads a chance to die gracefully
2016-11-13T21:16:30.334689Z 0 [Note] Shutting down slave threads
2016-11-13T21:16:32.334764Z 0 [Note] Forcefully disconnecting 1 remaining clients
2016-11-13T21:16:32.334833Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 694 user: 'root'
2016-11-13T21:16:32.334873Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2016-11-13T21:16:32.335122Z 0 [Note] Binlog end
2016-11-13T21:16:32.339336Z 0 [Note] Shutting down plugin 'auth_socket'
2016-11-13T21:16:32.339392Z 0 [Note] Shutting down plugin 'ngram'
2016-11-13T21:16:32.339403Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-11-13T21:16:32.339412Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-11-13T21:16:32.339423Z 0 [Note] Shutting down plugin 'partition'
2016-11-13T21:16:32.339431Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-11-13T21:16:32.339476Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-11-13T21:16:32.339515Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-11-13T21:16:32.339525Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-11-13T21:16:32.339532Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-11-13T21:16:32.339539Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-11-13T21:16:32.339546Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-11-13T21:16:32.339553Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-11-13T21:16:32.339560Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-11-13T21:16:32.339568Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-11-13T21:16:32.339574Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-11-13T21:16:32.339582Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-11-13T21:16:32.339589Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-11-13T21:16:32.339596Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-11-13T21:16:32.339603Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-11-13T21:16:32.339610Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-11-13T21:16:32.339617Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-11-13T21:16:32.339624Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-11-13T21:16:32.339632Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-11-13T21:16:32.339639Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-11-13T21:16:32.339646Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-11-13T21:16:32.339653Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-11-13T21:16:32.339660Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-11-13T21:16:32.339667Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-11-13T21:16:32.339674Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-11-13T21:16:32.339681Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-11-13T21:16:32.339688Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-11-13T21:16:32.339695Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-11-13T21:16:32.339702Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-11-13T21:16:32.339709Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-11-13T21:16:32.339716Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-11-13T21:16:32.339723Z 0 [Note] Shutting down plugin 'InnoDB'
2016-11-13T21:16:32.339835Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-11-13T21:16:32.340040Z 0 [Note] InnoDB: Starting shutdown...
2016-11-13T21:16:32.440431Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-11-13T21:16:32.442102Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 161114 0:16:32
2016-11-13T21:16:33.693460Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1145487137
2016-11-13T21:16:33.696592Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-11-13T21:16:33.696612Z 0 [Note] Shutting down plugin 'CSV'
2016-11-13T21:16:33.696620Z 0 [Note] Shutting down plugin 'MyISAM'
2016-11-13T21:16:33.696636Z 0 [Note] Shutting down plugin 'MEMORY'
2016-11-13T21:16:33.696643Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-11-13T21:16:33.696649Z 0 [Note] Shutting down plugin 'sha256_password'
2016-11-13T21:16:33.696654Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-11-13T21:16:33.696846Z 0 [Note] Shutting down plugin 'binlog'
2016-11-13T21:16:33.697556Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2016-11-13T21:16:34.391910Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-13T21:16:34.393679Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.16-0ubuntu0.16.04.1) starting as process 11999 ...
2016-11-13T21:16:34.398826Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-11-13T21:16:34.398868Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-11-13T21:16:34.398901Z 0 [Note] InnoDB: Uses event mutexes
2016-11-13T21:16:34.398909Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-11-13T21:16:34.398917Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-11-13T21:16:34.398926Z 0 [Note] InnoDB: Using Linux native AIO
2016-11-13T21:16:34.399236Z 0 [Note] InnoDB: Number of pools: 1
2016-11-13T21:16:34.399367Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-11-13T21:16:34.401161Z 0 [Note] InnoDB: Initializing buffer pool, total size = 384M, instances = 1, chunk size = 128M
2016-11-13T21:16:34.430483Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-11-13T21:16:34.435956Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-11-13T21:16:34.448305Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-11-13T21:16:34.477302Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-11-13T21:16:34.477400Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-11-13T21:16:34.506522Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-11-13T21:16:34.508083Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-11-13T21:16:34.508110Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-11-13T21:16:34.508531Z 0 [Note] InnoDB: Waiting for purge to start
2016-11-13T21:16:34.564382Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-11-13T21:16:35.618270Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161114 0:16:35
nginx vhosts NAME.conf
fastcgi_cache_path /etc/nginx/vhosts-resources/NAME.ru levels=2 keys_zone=NAME:100m max_size=256m inactive=60m;
server {
server_name NAME.ru www.NAME.ru;
charset UTF-8;
index index.html index.php;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/NAME.ru/*.conf;
access_log /var/www/httpd-logs/NAME.ru.access.log;
error_log /var/www/httpd-logs/NAME.ru.error.log notice;
ssi on;
set $root_path /var/www/www-root/data/www/NAME.ru;
root $root_path;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $do_not_cache 1;
}
fastcgi_cache_bypass $do_not_cache;
fastcgi_no_cache $do_not_cache;
fastcgi_pass_header Cookie;
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_cache NAME;
fastcgi_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
fastcgi_cache_valid 200 301 302 304 8h;
fastcgi_cache_valid 404 8h;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js|zip|rar)$ {
root /var/www/www-root/data/www/NAME.ru;
expires 10d;
access_log off;
log_not_found off;
}
location @php {
fastcgi_index index.php;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f NAME@mail.ru";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
try_files $uri =404;
include fastcgi_params;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri @wordpress;
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
}
location @wordpress {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_index index.php;
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
}
location ~ ^/(wp-admin/.*\.php|wp-login\.php|wp-register\.php|(feed|comment/feed)(/.*)?)$ {
try_files $uri @wordpress;
set $do_not_cache 1;
fastcgi_cache_bypass 1;
fastcgi_no_cache 1;
fastcgi_pass unix:/var/www/php-fpm/ch33ch.sock; #не забудьте поменять
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @php;
}
}
gzip on;
gzip_disable "msie6";
gzip_min_length 1000;
gzip_proxied any;
gzip_comp_level 7;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
expires 3d;
server_tokens off;
open_file_cache max=65000 inactive=200s;
open_file_cache_valid 300s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
listen IP:80 default_server;
}
nginx.conf
user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
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;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 1000;
gzip_comp_level 7;
gzip_buffers 16 8k;
gzip_static on;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/xml+rss;
server_tokens off;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/vhosts/*/*.conf;
client_max_body_size 128m;
server {
server_name localhost;
disable_symlinks if_not_owner;
listen 80;
include /etc/nginx/vhosts-includes/*.conf;
location @fallback {
error_log /dev/null crit;
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off ;
}
}
}
/etc/php/7.0/fpm/php.ini
max_execution_time 30
max_file_uploads 20
max_input_nesting_level 64
max_input_time 60
max_input_vars 1000
memory_limit 128M
output_buffering 4096
post_max_size 200M
realpath_cache_size 16K
realpath_cache_ttl 120
upload_max_filesize 200M
opcache.enable On
opcache.file_cache_only 0
opcache.file_update_protection 2
opcache.force_restart_timeout 180
opcache.inherited_hack On
opcache.interned_strings_buffer 4
opcache.lockfile_path / tmp
opcache.max_accelerated_files 2000
opcache.max_file_size 0
opcache.max_wasted_percentage 5
opcache.memory_consumption 64
opcache.protect_memory 0
opcache.revalidate_freq 2
opcache.save_comments 1
opcache.use_cwd On
opcache.validate_timestamps On
cgi.check_shebang_line 1
cgi.discard_path 0
cgi.fix_pathinfo 1
cgi.force_redirect 1
cgi.nph 0
cgi.rfc2616_headers 0
fastcgi.logging 1
memcache.chunk_size 32768
memcache.compress_threshold 20000
memcache.lock_timeout 15
session.auto_start 0
session.cache_expire 180
session.cache_limiter nocache
session.save_handler files
session.save_path /var/lib/php/sessions
session.serialize_handler php
Много менял параметры mysql, но казалось становилось хуже и хуже, после тюнинга mysql также. Жду любых советов от Вас и поправок, что мне нужно еще прислать для более полного понимания работы? подскажите куда мне копать? Спасибо за любую помощь заранее
Перемещено leave из general