We have centos 3.4 running on our server.
We have started encountering random hangs
Upon investgation it appears that server hangs are caused by slowly building memory usage until eventually server falls over.
My linux guy has been running some scripts to track memory usage and it appears to be MySql that is slowly but surely eating up ram
We have a lot of phpnuke and forums running on this particular server so mysql does get hammered.
relevant snippet from my.cnf:-
# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 6M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
He wrote a small perl script to ascertain mysql process memory usage as follows:-
#!/usr/bin/perl
$date = scalar localtime;
$ps = `ps -eo pid,user,rss,args`;
@procs = split /\n/, $ps;
open LOGF, ">>/var/tmp/process_mem.log";
print LOGF "\n$date\n";
foreach $proc (@procs) {
chomp $proc;
@a = split /\s+/, $proc;
if (@a[2] >= 71680) {
print LOGF "@a[3] (@a[0]) using more than 70mb memory - (@a[2] kb)\n";
}
}
print LOGF "\n*******
initially the log had entries like this from last night after a reboot:-
Thu Sep 8 23:30:00 2005
/usr/sbin/mysqld (14878) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (15946) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (20824) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (10875) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (13544) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (13607) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (14470) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (15814) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (16617) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (17514) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (19699) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (19858) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (19862) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (21547) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (23329) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (23470) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (23473) using more than 70mb memory - (94584 kb)
/usr/sbin/mysqld (23624) using more than 70mb memory - (94584 kb)
at present time this is already up to the following:-
Fri Sep 9 10:30:00 2005
/usr/sbin/mysqld (20824) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (19858) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26125) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (11562) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (17485) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (19113) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (19340) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (22260) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (23813) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (25843) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26635) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26636) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26637) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26638) using more than 70mb memory - (139728 kb)
/usr/sbin/mysqld (26639) using more than 70mb memory - (139728 kb)
and indications are this will just increase over time until next crash.
free command result:-
free
total used free shared buffers cached
Mem: 2045964 1581428 464536 0 82544 442620
-/+ buffers/cache: 1056264 989700
Swap: 2040244 198252 1841992
Below is the MRTG swap file stats for the server
![]()
HELP
ANyone got any ideas as to why this is happening ?



LinkBack URL
About LinkBacks

Reply With Quote




