Hello,
I know this issue has cropped up before, but I've not found any real answers to it.
64 bit CentOS with 12 GB RAM.
# mysql -V
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
I'm regularly getting:
101111 11:02:04 [ERROR] /usr/libexec/mysqld: Out of memory (Needed xxx bytes)
101111 11:02:04 [ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
101111 11:02:52 InnoDB: Error: cannot allocate xxx bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 26815930 bytes. Operating system errno: 12
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: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds..
/etc/my.cnf:
datadir=/var/lib/mysql
skip-locking
safe-show-database
query_cache_limit=2M
query_cache_size=128M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections=250 ## 30 is not enough (neither was 120 - pete)
max_connections=250
interactive_timeout=10
wait_timeout=60
connect_timeout=20
thread_cache_size=128
key_buffer=64M ## 32MB for every 1GB of RAM
join_buffer=2M
max_connect_errors=20
max_allowed_packet=16M
table_cache=3500
record_buffer=2M
sort_buffer_size=8M ## 1MB for every 1GB of RAM
read_buffer_size=8M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=4M ## 1MB for every 1GB of RAM
thread_concurrency=8 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server-id=1
open_files_limit=8192
collation_server=utf8_unicode_ci
character_set_server=utf8
max_heap_table_size=64M
log-error=/var/log/mysqld.log
tmp_table_size = 64M
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 104448
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 104448
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited
Memory usage appears to be fairly healthy:
# free -m
total used free shared buffers cached
Mem: 12004 8268 3735 0 247 5591
-/+ buffers/cache: 2429 9574
Swap: 14009 1444 12565
, and there are typically only 3 or 4 connections to MySQL.
This isn't a dedicated database machine - it runs Apache also.
Any ideas please? I've tried tweaking a few of the innodb settings, but am not so hot on innodb as myisam
I know this issue has cropped up before, but I've not found any real answers to it.
64 bit CentOS with 12 GB RAM.
# mysql -V
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
I'm regularly getting:
101111 11:02:04 [ERROR] /usr/libexec/mysqld: Out of memory (Needed xxx bytes)
101111 11:02:04 [ERROR] Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
101111 11:02:52 InnoDB: Error: cannot allocate xxx bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 26815930 bytes. Operating system errno: 12
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: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds..
/etc/my.cnf:
datadir=/var/lib/mysql
skip-locking
safe-show-database
query_cache_limit=2M
query_cache_size=128M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections=250 ## 30 is not enough (neither was 120 - pete)
max_connections=250
interactive_timeout=10
wait_timeout=60
connect_timeout=20
thread_cache_size=128
key_buffer=64M ## 32MB for every 1GB of RAM
join_buffer=2M
max_connect_errors=20
max_allowed_packet=16M
table_cache=3500
record_buffer=2M
sort_buffer_size=8M ## 1MB for every 1GB of RAM
read_buffer_size=8M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=4M ## 1MB for every 1GB of RAM
thread_concurrency=8 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server-id=1
open_files_limit=8192
collation_server=utf8_unicode_ci
character_set_server=utf8
max_heap_table_size=64M
log-error=/var/log/mysqld.log
tmp_table_size = 64M
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 104448
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 104448
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited
Memory usage appears to be fairly healthy:
# free -m
total used free shared buffers cached
Mem: 12004 8268 3735 0 247 5591
-/+ buffers/cache: 2429 9574
Swap: 14009 1444 12565
, and there are typically only 3 or 4 connections to MySQL.
This isn't a dedicated database machine - it runs Apache also.
Any ideas please? I've tried tweaking a few of the innodb settings, but am not so hot on innodb as myisam