Re: FreeBSD 5.2: malloc(): error: allocation failed

From: Melvyn Sopacua <freebsd-current_at_webteckies.org>
Date: Wed, 28 Jan 2004 10:50:06 +0100
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 = 256M

> sort_buffer_size = 1M
> read_buffer_size = 1M

> max_connections = 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 =
> 155824
>  K
> bytes of memory

This is bogus:
256 + ( 1 + 1) * 2000 = 2256M.

So you're bound to get into trouble with a large number of connections (or be 
swapping at least, which defeats the purpose of having a large 
key_buffer_size).

Secondly - the calculation is independent of InnoDB values, you should add 
innodb_buffer_pool_size to the equation:
innodb_buffer_pool_size + key_buffer_size + (read_buffer_size + 
sort_buffer_size) * max_used_connections = max_used_memory_since_startup

These values are *all* malloced and as such affect MAXDSIZE.
-- 
Melvyn

=======================================================
FreeBSD sarevok.webteckies.org 5.2-CURRENT FreeBSD 5.2-CURRENT #3: Tue Dec 30 
14:31:47 CET 2003     
root_at_sarevok.idg.nl:/usr/obj/usr/src/sys/SAREVOK_NOAPM_NODEBUG  i386
=======================================================

Received on Wed Jan 28 2004 - 00:50:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:40 UTC