Lots of MySql sessions open

chartmusic

Verified User
Joined
Sep 27, 2006
Messages
50
Location
North Devon
Hi guys,

Started to see loads of MySQL session open for a very long time. Don't looks normal to me.

Here's a snippet from top.
You can see there are sessions over 6 hours old. And they are taking up quite a bit of memory.
3184 mysql 16 0 92648 68m 1968 S 0 3.4 0:23.93 mysqld
3805 mysql 16 0 92648 68m 1968 S 0 3.4 0:00.02 mysqld
3806 mysql 16 0 92648 68m 1968 S 0 3.4 0:51.20 mysqld
3835 mysql 15 0 92648 68m 1968 S 0 3.4 6:22.55 mysqld
3836 mysql 16 0 92648 68m 1968 S 0 3.4 6:55.30 mysqld
3839 mysql 16 0 92648 68m 1968 S 0 3.4 6:46.64 mysqld
3846 mysql 16 0 92648 68m 1968 S 0 3.4 6:20.83 mysqld
4388 mysql 16 0 92648 68m 1968 S 0 3.4 5:50.50 mysqld
5365 mysql 15 0 92648 68m 1968 S 0 3.4 5:17.79 mysqld
5422 mysql 16 0 92648 68m 1968 S 0 3.4 5:17.56 mysqld
5561 mysql 16 0 92648 68m 1968 S 0 3.4 5:05.80 mysqld
5562 mysql 16 0 92648 68m 1968 S 0 3.4 5:05.43 mysqld
5563 mysql 16 0 92648 68m 1968 S 0 3.4 5:01.62 mysqld
5564 mysql 16 0 92648 68m 1968 S 0 3.4 5:00.59 mysqld
5565 mysql 17 0 92648 68m 1968 S 0 3.4 5:09.75 mysqld
5566 mysql 16 0 92648 68m 1968 S 0 3.4 5:26.28 mysqld
5567 mysql 16 0 92648 68m 1968 S 0 3.4 4:59.44 mysqld
5568 mysql 16 0 92648 68m 1968 S 0 3.4 5:05.14 mysqld
12244 mysql 16 0 92648 68m 1968 S 0 3.4 2:14.67 mysqld
12609 mysql 16 0 92648 68m 1968 S 3 3.4 2:09.25 mysqld
12610 mysql 15 0 92648 68m 1968 S 0 3.4 2:08.11 mysqld
12852 mysql 16 0 92648 68m 1968 S 0 3.4 2:01.69 mysqld
12853 mysql 15 0 92648 68m 1968 S 0 3.4 2:05.00 mysqld
12854 mysql 16 0 92648 68m 1968 S 0 3.4 2:02.94 mysqld
12855 mysql 16 0 92648 68m 1968 S 0 3.4 2:07.77 mysqld
12857 mysql 16 0 92648 68m 1968 S 0 3.4 2:01.51 mysqld
12860 mysql 16 0 92648 68m 1968 S 0 3.4 2:06.73 mysqld
12865 mysql 16 0 92648 68m 1968 S 0 3.4 2:04.40 mysqld
12866 mysql 16 0 92648 68m 1968 S 0 3.4 2:01.04 mysqld
14499 mysql 16 0 92648 68m 1968 S 0 3.4 1:46.50 mysqld
14500 mysql 16 0 92648 68m 1968 S 0 3.4 1:51.58 mysqld
14501 mysql 16 0 92648 68m 1968 S 0 3.4 1:48.38 mysqld
14502 mysql 16 0 92648 68m 1968 S 0 3.4 1:51.10 mysqld
14503 mysql 16 0 92648 68m 1968 S 0 3.4 1:47.96 mysqld
14504 mysql 16 0 92648 68m 1968 S 0 3.4 1:46.00 mysqld
14971 mysql 16 0 92648 68m 1968 S 0 3.4 1:44.78 mysqld
14973 mysql 16 0 92648 68m 1968 S 0 3.4 1:44.55 mysqld

Is this normal? Is there a way these inactive sessions can be closed in a nice way?

Thanks.
 
Last edited:
restarting mysqld will shut down all the sessions; users and programs will start new ones as they require.

Jeff
 
lower the wait_timeout value in my.cnf

Here is my.cnf
[mysqld]
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=260
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout
As you can see the wait timeout is set to 100. I assume that is 100 seconds, yet for some reason it is going on forever.
Any other suggestions?
 
Last edited:
Back
Top