I need some help with a server running a single website. The memory is increasing really fast, about 1GB per day.
Restarting php-fpm and nginx is not freeing any memory.
I need to reboot the whole server every 15 days, I can't figure out the problem since 4 months now.
Here is the status and conf files, I hope you can help ;)
Using
Nginx/1.4.5 PHP 5.5.3-1ubuntu2.3
APCu Version 4.0.1
Memcached and php memcache
Memcache status :
Free: 46.3 MBytes (72.4%)
Used: 17.7 MBytes (27.6%)
Hits: 30985436 (60.3%)
Misses: 20412444 (39.7%)
Used Cache Size 17.7 MBytes
Total Cache Size 64.0 MBytes
APCu status
Free: 1023.4 MBytes (99.9%)
Used: 637.7 KBytes (0.1%)
Hits: 40594423 (100.0%)
Misses: 428 (0.0%)
Request Rate (hits, misses) 73.83 cache requests/second
Hit Rate 73.83 cache requests/second
Nginx status :
Active connections: 146
server accepts handled requests
8792651 8792651 17113216
Reading: 0 Writing: 11 Waiting: 135
php fpm status :
pool: www
process manager: static
start time: 05/Jun/2014:09:44:04 +0200
start since: 549019
accepted conn: 62499
listen queue: 0
max listen queue: 0
listen queue len: 0
idle processes: 33
active processes: 27
total processes: 60
max active processes: 61
max children reached: 0
slow requests: 14236
top command :
top - 18:13:51 up 6 days, 8:29, 1 user, load average: 0,56, 0,57, 0,66
Tasks: 193 total, 2 running, 191 sleeping, 0 stopped, 0 zombie
%Cpu(s): 13,6 us, 1,0 sy, 0,0 ni, 85,1 id, 0,0 wa, 0,0 hi, 0,3 si, 0,0 st
KiB Mem: 32840792 total, 9399012 used, 23441780 free, 465028 buffers
KiB Swap: 1046520 total, 0 used, 1046520 free, 1931844 cached
File : php-fpm.conf
[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php/php5-fpm.log
log_level = notice
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 20s
include=/etc/php5/fpm/pool.d/*.conf
File : pool.d/www.conf
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.backlog = 65536
pm = static
pm.max_children = 60
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 5000
pm.status_path = /php-status
ping.path = /php-ping
slowlog = /var/log/php/$pool.log.slow
request_slowlog_timeout = 30s
request_terminate_timeout = 120s
rlimit_files = 131072
rlimit_core = unlimited
chdir = /
catch_workers_output = yes
security.limit_extensions = .php .php3 .php4 .php5 .jpg
File : sysctl.conf
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.eth0.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.eth0.accept_ra = 0
net.core.somaxconn=65535
fs.file-max = 100000
kernel.pid_max = 1048576
net.core.wmem_max = 1048576
net.core.optmem_max = 1048576
vm.max_map_count = 262144
net.core.rmem_max = 1048576
Thank you !
regards,
Anthony
Related
I use mariadb 10.5 with galera 4. I have a 3 node cluster which worked perfectly for the past 6 months. Lately I have been having problems with very cpu intensive query and had to kill that process. One of the nodes (n1) went out of sync so I recreated it. Everything synced perfectly but since that day n1 shows wsrep_cluster_size=0 and the rest of them show wsrep_cluster_size=3.
After a couple of days I decided to stop n2 and n3 to recreate it from n1. Again everything went smoothly but now n3 shows wsrep_cluster_size=0 and n1,n2 show wsrep_cluster_size=3.
I have no idea what's going on. I've checked all the logs and manually checked all the tables and everything seems ok. Data is synced and database is working just fine.
Heres is my configuration
[mysqld]
binlog_format = ROW
bind-address = 0.0.0.0
# Galera Provider Configuration
wsrep_on = ON
wsrep_provider = /usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name = cluser
wsrep_cluster_address = gcomm://10.0.0.2,10.0.0.3,10.0.0.4
wsrep_node_address = 10.0.0.2
wsrep_node_name = n1
# Galera Synchronization Configuration
wsrep_sst_method = rsync
log_error = /var/lib/mysql/node.log
default_storage_engine = InnoDB
innodb_autoinc_lock_mode = 2
innodb_locks_unsafe_for_binlog = 1
innodb_file_per_table = 1
#innodb_thread_concurrency = 0
innodb_buffer_pool_size = 10G
#innodb_log_buffer_size = 64M
innodb_flush_method = O_DIRECT
innodb_log_file_size = 2G
innodb_log_files_in_group = 2
wsrep_slave_threads = 5
innodb_locks_unsafe_for_binlog = 1
innodb_autoinc_lock_mode = 2
skip-name-resolve
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer_size = 16M
max_connections = 300
wait_timeout = 20
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
expire_logs_days = 10
max_binlog_size = 100M
Here is my SHOW STATUS LIKE 'wsrep%' for 3 nodes
https://pastebin.com/GXj0c38R
And logs
https://pastebin.com/YxJBcguK
This is definitely a bug. Please report it on MariaDB JIRA.
In addition to the wsrep_cluster_size=0 on n3, wsrep_cluster_conf_id is uninitialised (and not the 23 like other nodes) and wsrep_cluster_state_uuid is blank.
For a synced node I'd expect these to have consistent values on all nodes.
I have slow queries with a mysql request. But the request is not difficult:
SELECT * FROM emailarchiv WHERE typ='MAIL' AND benutzer = '542' ORDER BY datum DESC LIMIT 0,50;
# User#Host: XXX[XXX] # localhost []
# Thread_id: 13245239 Schema: usr_XXX_1 QC_hit: No
# Query_time: 20.919740 Lock_time: 0.000066 Rows_sent: 50 Rows_examined: 79212
Ok, in the database are 79212 entrys...but 20seconds???
My System: Centos7 MariaDB 5.5, 10GB RAM, 10 CPUs
Here my my.conf:
[mysqld]
local-infile = 0
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user = mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
# Forced OLD_PASSWORD format is turned OFF by Plesk
#old_passwords = 1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links = 0
max_connections = 100
#port = 3306 #Port nicht aendern
key_buffer_size = 512M
max_allowed_packet = 256M
table_open_cache = 4096
sort_buffer_size = 64M
net_buffer_length = 128K
read_buffer_size = 1512K
read_rnd_buffer_size = 4096K
myisam_sort_buffer_size = 64M
max_heap_table_size = 512M
tmp_table_size = 1024M
key_cache_block_size = 4096
query_cache_size = 512M
query_cache_limit = 512M
thread_cache_size = 20
table_cache = 16384
#open_files_limit = 9212 #nicht aktivieren!! Verursacht Probleme...
#wait_timeout = 10 #nicht aktivieren !!
join_buffer_size = 32M
#bind-address = 127.0.0.1
#Aenderungen ab 23.07.2021
innodb_buffer_pool_size = 512M
max_heap_table_size= 1024M
skip-name-resolve
slow-query-log = 1
slow-query-log-file = /srv/slow-query.log
long_query_time = 5
ssl-ca=/etc/mysql-ssl/ca-cert.pem
ssl-cert=/etc/mysql-ssl/server-cert.pem
ssl-key=/etc/mysql-ssl/server-key.pem
[mysqld_safe]
#log-error = /var/log/mysqld.log
What goes here wrong?
I solved the problem by myself ;-)
I don't use indexes for the rows "typ" and "benutzer" that was the problem. Now the Query_time is 2 seconds 👍
I installed Mariadb 10.5.12-1.el7 on Centos 7.9
Sometimes when I run some query like "SHOW VARIABLES LIKE 'max_join_size';" , this message appear :
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 3515012
Current database: *** NONE ***
I setup a cluster Packemaker/drbd/mariadb
And these are the conf:
max_allow_packet = 1G
bind-address = 0.0.0.0
datadir= /db/mysql/
socket=/db/mysql/mysql.sock
log_error=/var/log/mariadb/error.log
skip-external-locking
innodb_buffer_pool_size = 75G
innodb_log_file_size = 18G
innodb_buffer_pool_instances = 75
max_allowed_packet = 1G
thread_stack = 256K
thread_cache_size = 2000
max_connections = 2000
query_cache_limit = 256K
table_open_cache = 2000
table_definition_cache = 1400
expire_logs_days = 10
max_binlog_size = 100M
default_storage_engine = innodb
innodb_file_per_table = 1
interactive_timeout = 30
wait_timeout = 30
query_cache_type = 1
query_cache_size = 36M
query_cache_min_res_unit = 2K
What is the cause of this issue ?
Thanks
I have problems with my DB proceses
I runn an website developed using angular, typescript and laravel
Script demo: https://codecanyon.net/item/mtdb-ultimate-movietv-database/6447206
Script documentation: https://support.vebto.com/help-center/categories/35/mtdb-ultimate-movieandtv-database
Server:
Processor: Intel 2x Xeon Silver 4214 - 24 c / 48 t - 2.2 GHz / 3.2 GHz
Memory: 96GB DDR4 ECC 2400MHz
Storage: 2x960GB SSD NVMe Soft RAID 1
PHP 7.3 fcgi
mysql - MariaBD 10.3:
[mysqld]
log-error=/var/lib/mysql/server188.com.err
performance-schema=0
innodb_file_per_table=1
local-infile=0
key_buffer_size = 256M
max_allowed_packet = 268435456
innodb_buffer_pool_size=134217728
max_connections = 1000
max_user_connections = 500
wait_timeout = 28800
connect_timeout = 10
table_open_cache=4000
join_buffer_size = 1M
open_files_limit=10000
tmp_table_size = 64M
max_heap_table_size = 64M
read_buffer_size = 64M
concurrent_insert = 2
max_connect_errors = 10
net_buffer_length = 16384
myisam_sort_buffer_size = 64M
bulk_insert_buffer_size = 8M
thread_cache_size = 384
query_cache_limit = 7M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
max_write_lock_count = 16
#skip-networking
innodb_buffer_pool_size=4G
innodb_thread_concurrency=16
performance-schema=0
default-storage-engine=MyISAM
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M
The strangest thing is that when I get an cpu load of 16 - 17, my site stop loading, but others websites on the same server runn very well.
Also, the load NEVER pass of 17 cpu, but the server can handle 48
I think there is some limit somewhere.
Can someone make a suggestion?
so im currrently trying to stream my windows desktop using ffmpeg into a raspberry pi running ffserver.
The client software im using needs to use RTSP, however i cannot connect to the stream no matter what i try.
I even used VLC in the messages it just says it cannot connect to the stream.
Any help would be greatly appreciated!
Im attempting to access the stream with rtsp :// 169.254.70.227 :8544/test.flv, as soon as i do it stops the ffmpeg feed
FFserver conf
`RTSPPort 8544
HTTPPort 8090 # Port to bind the server to
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000 # Maximum bandwidth per client
# set this high enough to exceed stream bitrate
CustomLog - # Remove this if you want FFserver to daemoni$
<Feed feed1.ffm> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 100000K # Maximum file size for buffering video
ACL allow 192 .168.0.8
ACL allow 192 .168.0.17
ACL allow 169 .254.70.227
ACL allow 169 .254.9.29
ACL allow 169 .254.165.231
ACL allow 10 .14.2.197
ACL allow 192 .168.0.13
ACL allow 10 .14.2.197
ACL allow 192.16 8.0.13
ACL allow 192.1 68.1.3
ACL allow 192. 168.1.4
ACL allow 192 .168.1.2
</Feed>
<Stream test.flv> # Output stream URL definition
Format rtp
Feed feed1.ffm
NoAudio
# Video settings
VideoCodec libx264
VideoSize 720x576 # Video resolution
VideoBufferSize 2000
VideoFrameRate 30 # Video FPS
# Parameters passed to encoder
AVOptionVideo qmin 10
AVOptionVideo qmax 42
PreRoll 15
StartSendOnKey
MulticastAddress 224 .124.0.1
MulticastPort 5000
MulticastTTL 16
VideoBitRate 450 # Video bitrate
</Stream>
<Stream status.html> # Server status URL
Format status
# Only allow local people to get the status
ACL allow localhost
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168. 0.0 192.168. 255.255
</Stream>
<Redirect index. html> # Just an URL redirect for index
# Redirect index.html to the appropriate site
URL http ://www. ffmpeg .org/
</Redirect>`
FFmpeg feed
ffmpeg -rtbufsize 2100M -f dshow -r 29.970 -i video=screen-capture-recorder -c video=screen-capture-recorder.flv http :// 169 .254.70.227:8090/ feed1.ffm
FFserver output
configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
libavutil 55. 22.101 / 55. 22.101
libavcodec 57. 35.100 / 57. 35.100
libavformat 57. 34.103 / 57. 34.103
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 44.100 / 6. 44.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
/etc/ffserver.conf:48: Setting default value for video bit rate tolerance = 112500. Use NoDefaults to disable it.
/etc/ffserver.conf:48: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:48: Setting default value for video max rate = 20744848. Use NoDefaults to disable it.
Wed Apr 27 10:33:46 2016 FFserver started.
Wed Apr 27 10:33:46 2016 224.124.0.1:5000 - - "PLAY test.flv/streamid=0 RTP/MCAST"
Wed Apr 27 10:33:46 2016 [rtp # 0x13d4660]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Wed Apr 27 10:33:49 2016 169.254.165.231 - - [GET] "/feed1. ffm HTTP/1.1" 200 4175
FFMpeg output
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler # 000000000252f5e0] Warning: data is not aligned! This can lead to a speedloss
av_interleaved_write_frame(): Unknown errortime=00:00:05.00 bitrate= 249.0kbits/s speed=0.393x
Error writing trailer of http: //169. 254.70.227:8090/feed1.ffm: Error number -10053 occurredframe= 204 fps= 15 q=26.0 Lsize= 164kB time=00:00:05.03 bitrate= 266.9kbits/s speed=0.365x
video:155kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.475512%
[libx264 # 00000000025187e0] frame I:1 Avg QP:34.24 size: 32151
[libx264 # 00000000025187e0] frame P:59 Avg QP:27.14 size: 1807
[libx264 # 00000000025187e0] frame B:144 Avg QP:32.16 size: 168
[libx264 # 00000000025187e0] consecutive B-frames: 4.9% 2.0% 2.9% 90.2%
[libx264 # 00000000025187e0] mb I I16..4: 26.0% 23.1% 50.9%
[libx264 # 00000000025187e0] mb P I16..4: 1.9% 1.6% 1.1% P16..4: 4.3% 0.6% 0.4% 0.0% 0.0% skip:90.2%
[libx264 # 00000000025187e0] mb B I16..4: 0.2% 0.1% 0.1% B16..8: 3.1% 0.1% 0.0% direct: 0.1% skip:96.3% L0:26.0% L1:73.5% BI: 0.5%
[libx264 # 00000000025187e0] final ratefactor: 24.13
[libx264 # 00000000025187e0] 8x8 transform intra:31.8% inter:47.1%
[libx264 # 00000000025187e0] coded y,u,v intra: 28.1% 8.2% 6.3% inter: 0.6% 0.2% 0.1%
[libx264 # 00000000025187e0] i16 v,h,dc,p: 30% 63% 6% 1%
[libx264 # 00000000025187e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 16% 63% 1% 0% 0% 1% 0% 3%
[libx264 # 00000000025187e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 39% 15% 2% 2% 3% 4% 3% 4%
[libx264 # 00000000025187e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 00000000025187e0] ref P L0: 66.3% 13.1% 16.9% 3.6%
[libx264 # 00000000025187e0] ref B L0: 66.6% 29.7% 3.8%
[libx264 # 00000000025187e0] ref B L1: 91.7% 8.3%
[libx264 # 00000000025187e0] kb/s:191.78
Conversion failed!