From owner-freebsd-questions@FreeBSD.ORG Wed Feb 11 05:15:26 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66707106566C for ; Wed, 11 Feb 2009 05:15:26 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 29D748FC15 for ; Wed, 11 Feb 2009 05:15:26 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.lan.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 44A73AFC1FF; Tue, 10 Feb 2009 20:15:25 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Tue, 10 Feb 2009 20:15:07 -0900 User-Agent: KMail/1.9.10 References: <139b44430902100849r30b5144cxb5770fa45fa6c906@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902102015.07663.fbsd.questions@rachie.is-a-geek.net> Cc: Ivan Voras , Valentin Bud Subject: Re: mysqld out of memory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 05:15:26 -0000 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 -e"SHOW 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.