From owner-freebsd-current@FreeBSD.ORG Wed Jan 28 01:50:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAD7716A4CE for ; Wed, 28 Jan 2004 01:50:13 -0800 (PST) Received: from sarevok.webteckies.org (node123e0.a2000.nl [24.132.35.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30FC943D31 for ; Wed, 28 Jan 2004 01:50:12 -0800 (PST) (envelope-from mdev@sarevok.webteckies.org) Received: by sarevok.webteckies.org (Postfix, from userid 100) id 36098B82A; Wed, 28 Jan 2004 10:50:11 +0100 (CET) From: Melvyn Sopacua Organization: WebTeckies.org To: current@FreeBSD.org Date: Wed, 28 Jan 2004 10:50:06 +0100 User-Agent: KMail/1.5.94 References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_SX4FATv7FaafELM"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200401281050.10930.freebsd-current@webteckies.org> Subject: Re: FreeBSD 5.2: malloc(): error: allocation failed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 09:50:13 -0000 --Boundary-02=_SX4FATv7FaafELM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 25 January 2004 21:13, Christian B. wrote: > For the MySQL 4.0.17, I use following configuration (the same as under > FreeBSD 5.1): > ---------------------------------- > key_buffer =3D 256M > sort_buffer_size =3D 1M > read_buffer_size =3D 1M > max_connections =3D 2000 > ---------------------------------- > > But after I start the mysql-server, I get following error: > ---------------------------------- > It is possible that mysqld could use up to > key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = =3D > 155824 > K > bytes of memory This is bogus: 256 + ( 1 + 1) * 2000 =3D 2256M. So you're bound to get into trouble with a large number of connections (or = be=20 swapping at least, which defeats the purpose of having a large=20 key_buffer_size). Secondly - the calculation is independent of InnoDB values, you should add= =20 innodb_buffer_pool_size to the equation: innodb_buffer_pool_size + key_buffer_size + (read_buffer_size +=20 sort_buffer_size) * max_used_connections =3D max_used_memory_since_startup These values are *all* malloced and as such affect MAXDSIZE. =2D-=20 Melvyn =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =46reeBSD sarevok.webteckies.org 5.2-CURRENT FreeBSD 5.2-CURRENT #3: Tue De= c 30=20 14:31:47 CET 2003 =20 root@sarevok.idg.nl:/usr/obj/usr/src/sys/SAREVOK_NOAPM_NODEBUG i386 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --Boundary-02=_SX4FATv7FaafELM Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAF4XSOv9JNmfFN5URAoabAJ9DIqZLr54oeCw6medv9+eykJcZWgCeP2UL vTjGizctFjSXadbPcGI3/Rg= =JHhH -----END PGP SIGNATURE----- --Boundary-02=_SX4FATv7FaafELM--