@semenphp

Что может быть с сервером апачь?

Вообщем проблема очень частая, нагуглился вдоволь, не могу найти решения.
получается тормозит apache когда перезагружаю все работает но через минуту опять все виснет
8GB Ram 80GB SSD Disk Ubuntu Ubuntu 14.04 x64 Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz, 4 ядра
не могу разобраться в чем дело.
при торможения сайта в логах не чего страшного не происходит.
было подозрение на ddos атаку, но от исключено так как
ps aux | grep apache | wc -l
выдает всего 15 или 20
не думаю что из за 20 процессов может тормозить сайт
логи iptraf сбор данных во время торможения 1 час
нет подозрительных IP
логи mysql
160316 21:15:20 [Note] Event Scheduler: Purging the queue. 0 events
160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 57 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 55 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 54 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 50 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 49 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 48 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 47 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 45 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 44 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 43 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 42 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 41 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 40 user: 'ros_db'

160316 21:15:22 [Warning] /usr/sbin/mysqld: Forcing close of thread 5 user: 'ros_db'

160316 21:15:22 InnoDB: Starting shutdown...
160316 21:15:22 InnoDB: Waiting for 28 pages to be flushed
160316 21:15:23 InnoDB: Shutdown completed; log sequence number 108495241961
160316 21:15:23 [Note] /usr/sbin/mysqld: Shutdown complete

160316 21:15:23 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
160316 21:15:23 [Note] Plugin 'FEDERATED' is disabled.
160316 21:15:23 InnoDB: The InnoDB memory heap is disabled
160316 21:15:23 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160316 21:15:23 InnoDB: Compressed tables use zlib 1.2.8
160316 21:15:23 InnoDB: Using Linux native AIO
160316 21:15:23 InnoDB: Initializing buffer pool, size = 1.0G
160316 21:15:23 InnoDB: Completed initialization of buffer pool
160316 21:15:23 InnoDB: highest supported file format is Barracuda.
160316 21:15:23 InnoDB: Waiting for the background threads to start
160316 21:15:24 InnoDB: 5.5.47 started; log sequence number 108495241961
160316 21:15:24 [Warning] Failed to lock memory. Errno: 12

160316 21:15:24 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160316 21:15:24 [Note] - '0.0.0.0' resolves to '0.0.0.0';
160316 21:15:24 [Note] Server socket created on IP: '0.0.0.0'.
160316 21:15:24 [Warning] 'proxies_priv' entry '@ root@ros.ru' ignored in --skip-name-resolve mode.
160316 21:15:24 [Note] Event Scheduler: Loaded 0 events
160316 21:15:24 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.47-0ubuntu0.14.04.1-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
  • Вопрос задан
  • 743 просмотра
Пригласить эксперта
Ответы на вопрос 3
@semenphp Автор вопроса
логи apache
[Tue Mar 15 21:21:58.008459 2016] [:error] [pid 1702] [client 178.62.228.32:40676] PHP Stack trace:, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.008472 2016] [:error] [pid 1702] [client 178.62.228.32:40676] PHP 1. {main}() /home/ros/web/rosru/public_html/gzip.php:0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014375 2016] [:error] [pid 1692] [client 178.62.228.32:40677] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014382 2016] [:error] [pid 2595] [client 178.62.228.32:40678] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014707 2016] [:error] [pid 2595] [client 178.62.228.32:40678] PHP Notice: Undefined index: HTTP_IF_NONE_MATCH in /home/ros/web/ros.ru/public_html/gzip.php on line 31, referer: rosru/sony-xperia-e3
[Tue Mar 15 21:21:58.014723 2016] [:error] [pid 2595] [client 178.62.228.32:40678] PHP Stack trace:, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014722 2016] [:error] [pid 1692] [client 178.62.228.32:40677] PHP Notice: Undefined index: HTTP_IF_NONE_MATCH in /home/ros/web/ros.ru/public_html/gzip.php on line 31, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014735 2016] [:error] [pid 2595] [client 178.62.228.32:40678] PHP 1. {main}() /home/ros/web/rosru/public_html/gzip.php:0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014739 2016] [:error] [pid 1692] [client 178.62.228.32:40677] PHP Stack trace:, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.014752 2016] [:error] [pid 1692] [client 178.62.228.32:40677] PHP 1. {main}() /home/ros/web/ros.ru/public_html/gzip.php:0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:58.467259 2016] [:error] [pid 2524] [client 178.62.228.32:40679] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/sony-xperia-e3
[Tue Mar 15 21:21:59.882598 2016] [:error] [pid 1626] [client 178.62.228.32:40680] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/admin/edit_product/37483
[Tue Mar 15 21:21:59.937447 2016] [:error] [pid 1702] [client 178.62.228.32:40681] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/resources/css/style.css?v=9
[Tue Mar 15 21:22:01.135051 2016] [:error] [pid 2595] [client 178.62.228.32:40682] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: rosru/admin/orders
[Tue Mar 15 21:22:01.216977 2016] [:error] [pid 1692] [client 178.62.228.32:40683] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/resources/css/style.css?v=9
[Tue Mar 15 21:22:03.129943 2016] [:error] [pid 2524] [client 178.62.228.32:40684] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: ros.ru/tovary/zashitnoe-steklo-ultra-tempered-glas...
[Tue Mar 15 21:22:04.200340 2016] [:error] [pid 1626] [client 178.62.228.32:40685] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0
[Tue Mar 15 21:22:05.324678 2016] [:error] [pid 2599] [client 178.62.228.32:40686] PHP Warning: Unknown: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in Unknown on line 0, referer: /sony-xperia-e3/

команда top
1953 mysql 20 0 4393492 682772 7584 S 38.2 8.4 2:55.18 mysqld
4380 www-data 20 0 459604 22584 8328 S 3.7 0.3 0:00.30 apache2
2615 www-data 20 0 460960 27704 14064 S 3.0 0.3 0:04.47 apache2
4369 www-data 20 0 459116 26016 12208 S 2.7 0.3 0:01.64 apache2
1305 nginx 20 0 52984 3008 1028 S 0.7 0.0 0:04.18 nginx
4370 roscase 20 0 460284 28980 14016 S 0.7 0.4 0:00.96 apache2
7 root 20 0 0 0 0 S 0.3 0.0 0:01.42 rcu_sched
9 root 20 0 0 0 0 S 0.3 0.0 0:00.23 rcuos/1
1303 nginx 20 0 53108 3008 1028 S 0.3 0.0 0:03.88 nginx
2218 www-data 20 0 462188 31664 16872 S 0.3 0.4 0:05.05 apache2
4093 www-data 20 0 459700 24912 12584 S 0.3 0.3 0:01.10 apache2
4371 www-data 20 0 457552 21592 9396 S 0.3 0.3 0:01.21 apache2
4387 root 20 0 24920 1640 1176 R 0.3 0.0 0:00.05 top
1 root 20 0 33464 2820 1472 S 0.0 0.0 0:01.33 init

конфигурации apache
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf.d
# | `-- *

# Global configuration
PidFile ${APACHE_PID_FILE}
Timeout 30
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 10

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 200
MaxRequestsPerChild 4000

StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 200
MaxRequestsPerChild 4000

StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 200
MaxRequestsPerChild 4000

ExtendedStatus On

SetHandler server-status
Order deny,allow
Deny from all
Allow from all

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#User www-data
#Group www-data

AccessFileName .htaccess

Order allow,deny
Deny from all
Satisfy all

DefaultType None
HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include list of ports to listen on and which to use for name based vhosts
Include ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%b" bytes

Include conf.d/

# Include the virtual host configurations:
#Include sites-enabled/
#Alias /phpmyadmin /usr/share/phpmyadmin

конфиги mysql
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock
open-files-limit=32000
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[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
log_error=/var/log/mysql/error.log
max_allowed_packet=50M
max_connections=1000
max_user_connections=50
wait_timeout=100
interactive_timeout=10
long_query_time=5
skip-name-resolve
#
default-storage-engine = innodb

query_cache_size=30M
tmp_table_size=150M
max_heap_table_size=150M

memlock
table_cache=4096
thread_cache_size=300
thread_concurrency=2
log_slow_queries = /var/log/mysql/mysql-slow.log
long_query_time = 3

# InnoDb
innodb_file_per_table

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_log_group_home_dir = /var/lib/mysql/
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 20M
innodb_lock_wait_timeout = 120

innodb_thread_concurrency = 2
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT

# MyIsam
key_buffer_size = 1G
myisam_recover
myisam_repair_threads = 1
myisam_data_pointer_size = 6

!includedir /etc/mysql/conf.d/

этот сайт работал на сервере больше двух лет, и буквально вдруг снес чего стал тормозит.
помогите разобраться?
Ответ написан
Комментировать
iNickolay
@iNickolay
У вас тонны ошибок, начните с них
Ответ написан
@Bross
Что нибудь обновлялось\делалось на этом сервере?
Есть ли логи того, как работал сервер\машина раньше?
У Вас и nginx и apache работают. Что-то мне подскказывает, что на машине бардак.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы