The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 mysql error on freshports
Author: parv 
Date:   29-11-00 05:09

here is the error msg as of nov-28-2000-10.11p_us_edt:

Warning: MySQL Connection Failed: Too many connections in ./_private/commonlogin.php3 on line 47

Warning: 0 is not a MySQL link index in ./_private/commonlogin.php3 on line 48

Reply To This Message
 
 RE: mysql error on freshports
Author: Dan Langille 
Date:   29-11-00 08:18

Thanks. The box keeps gettting overloaded. It can't cope. I may reduce the number of Apache instances.

Reply To This Message
 
 RE: mysql error on freshports
Author: Michael Joyner 
Date:   01-12-00 04:22

You need to change
the settings mysqld is started with.

I use the following at work for my
www site.

(excerpt from /usr/local/bin/safe_mysqld)

echo "mysqld started on " `date` >> $err_log
while true
do
rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
if test "$#" -eq 0
then
nohup $ledir/mysqld -O max_connections=1000 -O wait_timeout=3600 --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR
>> $err_log 2>&1
else
nohup $ledir/mysqld -O max_connections=1000 -O wait_timeout=3600 --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR
"$@" >> $err_log 2>&1
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
break;
fi
echo "mysqld restarted on " `date` | tee -a $err_log
done

Reply To This Message
 
 RE: mysql error on freshports
Author: Dan Langille 
Date:   01-12-00 07:21

Your script differs quite bit from mine:

rm -f $MYSQL_UNIX_PORT $pid_file # Some extra safety
if test "$#" -eq 0
then
(trap "" 1 ; exec $NOHUP_NICENESS $ledir/mysqld -basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user -pid-file=$pid_fi
le >> $err_log 2>&1 )
else
(trap "" ; exec $NOHUP_NICENESS $ledir/mysqld -basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR --user=$user -pid-file=$pid_file "$@" >> $err_log 2>&1 )
fi

From what I can tell, you are adding:

-O max_connections=1000 -O wait_timeout=3600

I don't think that is suitable for this situation. The problem is that mysql is getting busy. Very busy. It's taking a long time to run a particular query. It's not that it's getting many connections. And I'm not going to increase the limit to 1000 connections. That's too many for this P100. And a time out of 1 hour? hmmm. Too much.

What do you think the problem is?

Reply To This Message
 
 RE: mysql error on freshports
Author: Michael Joyner 
Date:   03-12-00 16:49

The 1 hour time out is much less than
the default.

I was getting the same msgs you got
until I made these changes.

You might want to to use mysqladmin to see what your default
timeout is.

Reply To This Message
 
 RE: mysql error on freshports
Author: Dan Langille 
Date:   03-12-00 20:10

Thanks. I understand now. I've had a quite look at processlist and I found one query which was taking between 40 and 50 seconds. And there was one process which was sleeping and the time was 25169. Three other processes were at 13000 or so.

I'll look at improving that query and changing the timeouts. Cheers.

Reply To This Message
 
 RE: mysql error on freshports
Author: Dan Langille 
Date:   03-12-00 20:30

I've fixed the query. I'll monitor things over the next few days and report back. thanks.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org