Re: mysqld out of memory

2009-02-11 Thread Vincent Hoffman
On 10/2/09 16:58, Ivan Voras wrote:
 Valentin Bud wrote:

   
 I noticed that it is already at 1GB. Now my problem is how can i avoid this
 in the future because
 on that production server mysql is crucial or in case it happens how ca I be
 the first to know
 of that problem?
 

 If you examine the mysql-server script in /usr/local/etc/rc.d you'll see
 it supports the mysql_limits option for rc.conf. Set
 mysql_limits=YES to /etc/rc.conf and the server start with removed limits.

 You can increase maxdsiz (which is different than limits) by adding a
 line to loader.conf, something like:

 kern.maxdsiz=2GB
 kern.dfldsiz=2GB

 Note that you can't increase it to more than 3 GB on i386.

 Another thing is that mysql shouldn't take infinite amounts of memory to
 work. You need to configure entries in my.cnf to match your limits and
 maxdsiz (in steady state + estimated spikes).

   
I'd highly recommend databases/mysqltuner if only because it will tell
you the maximum possible memory your config will use (as well as
sensible config recommendations.)


Vince
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


mysqld out of memory

2009-02-10 Thread Valentin Bud
Hello community,

 Today I had for the first time this problem with mysql on a production
server.
The following start flowing in the mysql-err.log
090210  9:12:17 [ERROR] /usr/local/libexec/mysqld: Out of memory (Needed
1676280 bytes)

Doing a top resulted in mysql eating up about 2GB of memory of a total of 4
GB which
i have on that particular box. After googling a little i found some post on
the mailing list about
setting kern.maxdsiz to 1GB. After that I have checked out the kern.maxdsiz
with
# limits -Hd
Resource limits (current):
  datasize  1048576 kB

I noticed that it is already at 1GB. Now my problem is how can i avoid this
in the future because
on that production server mysql is crucial or in case it happens how ca I be
the first to know
of that problem?

I will post some info about the server
# uname -a
FreeBSD nemty 7.0-RELEASE FreeBSD 7.0-RELEASE #5: Tue Mar 25 16:38:28 CET
2008 r...@nemty:/usr/obj/usr/src/sys/NEMTY  i386

# mysqladmin version
...
Server version  5.0.75-log
...
If there are any other info that might help in troubleshooting this problem
i will be glad
to provide them. Thanks for yout input.

a great day,
v
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: mysqld out of memory

2009-02-10 Thread Ivan Voras
Valentin Bud wrote:

 
 I noticed that it is already at 1GB. Now my problem is how can i avoid this
 in the future because
 on that production server mysql is crucial or in case it happens how ca I be
 the first to know
 of that problem?

If you examine the mysql-server script in /usr/local/etc/rc.d you'll see
it supports the mysql_limits option for rc.conf. Set
mysql_limits=YES to /etc/rc.conf and the server start with removed limits.

You can increase maxdsiz (which is different than limits) by adding a
line to loader.conf, something like:

kern.maxdsiz=2GB
kern.dfldsiz=2GB

Note that you can't increase it to more than 3 GB on i386.

Another thing is that mysql shouldn't take infinite amounts of memory to
work. You need to configure entries in my.cnf to match your limits and
maxdsiz (in steady state + estimated spikes).



signature.asc
Description: OpenPGP digital signature


Re: mysqld out of memory

2009-02-10 Thread Mel
On Tuesday 10 February 2009 07:58:31 Ivan Voras wrote:
 Valentin Bud wrote:
  I noticed that it is already at 1GB. Now my problem is how can i avoid
  this in the future because
  on that production server mysql is crucial or in case it happens how ca I
  be the first to know
  of that problem?

[snip]

 Another thing is that mysql shouldn't take infinite amounts of memory to
 work. You need to configure entries in my.cnf to match your limits and
 maxdsiz (in steady state + estimated spikes).

More specifically:
http://lists.freebsd.org/pipermail/freebsd-questions/2008-April/173350.html

Use -eSHOW STATUS LIKE 'Max_used_connections' to get an indication of the 
number of connections you're seeing. Calculate your memory usage with that 
value, then see if it goes above memory limits.
Then try adjusting the key_buffer_size since it's globally allocated.

Note that this requires tuning. A lower key_buffer_size can mean that queries 
take longer, which in turn will increase your memory usage.

Things are more complicated with InnoDb.

http://dev.mysql.com/doc/refman/5.0/en/innodb-parameters.html
-- 
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org