Has anyone had any luck getting MySQL 4.0.18 (specifically
innodb_buffer_pool_size) to use large amounts of memory on a G5 running
OS X Server 10.3.3?

I initially tried with the MySQL built binary, and was unable to get
innodb_buffer_pool_size to go beyond 1.5 GB.  Here's the my.cnf section
that allowed MySQL to start:

>set-variable   = key_buffer=128M
>set-variable   = max_allowed_packet=1M
>set-variable   = table_cache=4096
>set-variable   = sort_buffer=4M
>set-variable   = max_connections=40
>set-variable   = record_buffer=2M
>set_variable   = tmp_table_size=2M
>set-variable   = thread_cache=8
>set-variable    = interactive_timeout=2000
>set-variable    = wait_timeout=2000
># Try number of CPU's*2 for thread_concurrency
>set-variable   = thread_concurrency=4
>set-variable   = myisam_sort_buffer_size=32M
>default-table-type=innodb
>set-variable   = long_query_time=120
>log-slow-queries
>set-variable   = query_cache_type=1
>set-variable   = query_cache_size=1M
>datadir            = /raid/mysql-data
>
># Uncomment the following if you are using InnoDB tables
>innodb_data_home_dir = /raid/mysql-data
>innodb_data_file_path = ibdata1:4000M;ibdata2:4000M:autoextend
>innodb_log_group_home_dir = /raid/mysql-data/
>innodb_log_arch_dir = /raid/mysql-data/
># You can set .._buffer_pool_size up to 50 - 80 %
># of RAM but beware of setting memory usage too high
>set-variable = innodb_log_files_in_group=4
>set-variable = innodb_buffer_pool_size=1536M
>set-variable = innodb_additional_mem_pool_size=10M
># Set .._log_file_size to 25 % of buffer pool size
>set-variable = innodb_log_file_size=200M
>set-variable = innodb_log_buffer_size=16M
>set-variable = innodb_flush_log_at_trx_commit=2
>set-variable = innodb_lock_wait_timeout=50
>set-variable = innodb_thread_concurrency=8

If I put innodb_buffer_pool_size=2048M on the pre-built binary MySQL
won't start, InnoDB dies trying to allocate memory:

>
>040414 12:01:32  mysqld started
>*** malloc: vm_allocate(size=2147504128) failed (error code=3)
>*** malloc[5630]: error: Can't allocate region
>InnoDB: Fatal error: cannot allocate 2147500032 bytes of
>InnoDB: memory with malloc! Total allocated memory
>InnoDB: by InnoDB 15438152 bytes. Operating system errno: 12
>InnoDB: Cannot continue operation!
>InnoDB: Check if you should increase the swap file or
>InnoDB: ulimits of your operating system.
>InnoDB: On FreeBSD check you have compiled the OS with
>InnoDB: a big enough maximum process size.
>InnoDB: We now intentionally generate a seg fault so that
>InnoDB: on Linux we get a stack trace.
>mysqld got signal 10;
>This could be because you hit a bug. It is also possible that this
>binary or one of the libraries it was linked against is corrupt,
>improperly built, or misconfigured. This error can also be caused by
>malfunctioning hardware. We will try our best to scrape up some info
>that will hopefully help diagnose the problem, but since we have
>already crashed, something is definitely wrong and this may fail.
>
>key_buffer_size=134217728
>read_buffer_size=2093056
>max_used_connections=0
>max_connections=40
>threads_connected=0
>It is possible that mysqld could use up to 
>key_buffer_size + (read_buffer_size +
>sort_buffer_size)*max_connections = 376671 K
>bytes of memory
>Hope that's ok; if not, decrease some variables in the equation.
>
>Writing a core file
>040414 12:01:33  mysqld ended

I then looked at some previous posts on this list about needing to
compile with G5 specific flags and the current OS X max memory per
process being 4GB.

List discussion:

<http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=
bv3gfm%242bga%241%40FreeBSD.csie.NCTU.edu.tw&rnum=1&prev=/groups%3Fq%
3Dmac%2520os%2520x%2520mysql%2520memory%2520g5%26hl%3Den%26lr%3D%26ie%
3DUTF-8%26oe%3DUTF-8%26sa%3DN%26tab%3Dwg>

G5 tuning:

<http://developer.apple.com/technotes/tn/tn2086.html#G5options>

So I compiled MySQL from source using this config line:

CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer -mcpu=970 -mtune=970
-mpowerpc64 -mpowerpc-gpopt" CXX=gcc CXXFLAGS="-O3
-fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti
-mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt" ./configure
--prefix=/usr/local/mysql --with-extra-charsets=complex
--enable-thread-safe-client --enable-local-infile --disable-shared
--with-innodb

Which is basically a combination of what Apple recommends and what MySQL
says is the config for the pre-built OS X binary.  This is using gcc 3.3
on the latest version of OS X Server with the latest version of the
developer tools (XTools) installed.

This improved things somewhat...innodb_buffer_pool_size will now go to 2
GB, but if I try to go beyond I get the same error.

Does anyone have suggestions for pushing innodb_buffer_pool_size beyond
2 GB?  We can decrease the MyISAM settings pretty drastically if
necessary as everything but the grant tables are InnoDB.  Still, even
with the settings above I would have expected to be able to get InnoDB
to 3 GB if the overall process limit is 4 GB.

Thanks for any help,
Ware Adams

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to