$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
$ sudo uname -a
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
AMD Athlon II X4 640 Processor (1800 MHz) , 4 cores
ASUS M4A78LT-M LE
HMT351U68FR8C-H9 4GB, PC3-10600, DDR3-1333MHZ
устройство SATA A 372.61 GB ATA SAMSUNG HD403LJ
устройство SATA B 298.09 GB ATA SAMSUNG HD321KJ
устройство SATA C 1.82 TB ATA ST2000DM001-1ER1
устройство SATA D 931.51 GB ATA WDC WD10EALX-009
nginx:
Spoiler
Код: Выделить всё
user www-data;
worker_processes 4;
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;
tcp_nodelay on;
server_tokens off;
server_names_hash_bucket_size 64;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 15m;
gzip on;
gzip_disable "msie6";
ssi on;
#limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}php5-fpm
www.conf
Spoiler
Код: Выделить всё
[site]
user = site
group = www-data
listen = /var/run/php5-fpm-$pool.sock
listen.owner = site
listen.group = www-data
listen.mode = 0660
pm = dynamic
pm.max_children = 7
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 4
pm.status_path = /status
ping.path = /ping
ping.response = pong
access.log = /home/site/logs/php-$pool.access.log
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
slowlog = /home/site/logs/php-slow.$pool.log
request_slowlog_timeout = 3s
chdir = /
php_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 32Mmysql:
my.cnf
Spoiler
Код: Выделить всё
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
max_connect_errors = 1K
join_buffer_size = 512K
table_open_cache = 1K
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 64M
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 2
expire_logs_days = 10
max_binlog_size = 100M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/mysqltuner
Spoiler
Код: Выделить всё
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.41-0+wheezy1-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 912M (Tables: 1508)
[--] Data in InnoDB tables: 651M (Tables: 1906)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 872K (Tables: 34)
[!!] Total fragmented tables: 1995
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 1h 29m 24s (2M q [455.316 qps], 67K conn, TX: 1B, RX: 229M)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 240.0M global + 3.1M per thread (151 max threads)
[OK] Maximum possible memory usage: 702.4M (18% of installed RAM)
[OK] Slow queries: 0% (201/2M)
[OK] Highest usage of available connections: 15% (23/151)
[OK] Key buffer size / total MyISAM indexes: 16.0M/281.2M
[OK] Key buffer hit rate: 100.0% (32M cached / 1K reads)
[OK] Query cache efficiency: 80.8% (1M cached / 2M selects)
[!!] Query cache prunes per day: 860150
[OK] Sorts requiring temporary tables: 1% (1K temp sorts / 54K sorts)
[!!] Joins performed without indexes: 22406
[OK] Temporary tables created on disk: 6% (3K on disk / 52K total)
[OK] Thread cache hit rate: 99% (74 created / 67K connections)
[!!] Table cache hit rate: 6% (1K open / 16K opened)
[OK] Open file limit used: 53% (1K/2K)
[OK] Table locks acquired immediately: 99% (711K immediate / 714K locks)
[!!] InnoDB data size / buffer pool: 651.7M/128.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 64M)
join_buffer_size (> 512.0K, or always use indexes with joins)
table_cache (> 1024)
innodb_buffer_pool_size (>= 651M)Вот нагрузка сайта
Код: Выделить всё
120 тысяч просмотров страниц
40-45 тысяч посетителейТематика сайта музыкальный все файла песен хранятся на жеских дисках.
Вопрос в следующем что можно поправить в конфигурациях чтоб уменьшить нагрузку потому как проц практички постоянно 100% загружен. Нагрузка идет от php5-fpm и mysql
Может железо сменить то на какое?