S
S
semenphp2016-03-16 15:51:45
Apache HTTP Server
semenphp, 2016-03-16 15:51:45

What can be with the Apache server?

In general, the problem is very frequent, I googled enough, I can not find a solution.
it turns out that apache slows down when I reboot everything works but after a minute everything hangs again
8GB Ram 80GB SSD Disk Ubuntu Ubuntu 14.04 x64 Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz, 4 cores
I can’t figure out what’s wrong.
when the site slows down in the logs, nothing terrible happens.
there was a suspicion of a ddos ​​attack, but it was excluded because
ps aux | grep apache | wc -l
gives only 15 or 20
I don't think that because of 20 processes the site can slow down
logs iptraf data collection during braking 1 hour
no suspicious IP
mysql logs
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 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 '@ [email protected]' 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)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
semenphp, 2016-03-16
@semenphp

apache logs
[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
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/commodity/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 /
Team 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 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
apache configuration init
# 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/
this site was running on the server for more than two years, and literally suddenly took down what became slow.
Help me to understand?

N
Nikolay, 2016-03-16
@iNickolay

You have tons of mistakes, start with them

B
Bross, 2016-03-16
@Bross

Has anything been updated/done on this server?
Are there any logs of how the server/machine worked before?
Both nginx and apache work for you. Something tells me that the car is a mess.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question