我有一个64GB的RAM服务器,并希望为mysql innodb缓冲池分配54GB。但是,我发现我不能分配超过43GB的Ram和mysql给我这个错误:
150709 17:54:54 InnoDB: Compressed tables use zlib 1.2.3
150709 17:54:54 InnoDB: Using Linux native AIO
150709 17:54:54 InnoDB: Initializing buffer pool, size = 44.0G
150709 17:54:56 InnoDB: Completed initialization of buffer pool
150709 17:54:56 InnoDB: highest supported file format is Barracuda.
150709 17:54:57 InnoDB: Assertion failure in thread 140200930457568 in file ut0mem.c line 103
InnoDB: Failing assertion: ret || !assert_on_error
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
09:54:57 UTC - mysqld got signal 6 ;
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=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=900
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1976970 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
/usr/libexec/mysqld(my_print_stacktrace+0x2e)[0x78cd5e]
/usr/libexec/mysqld(handle_fatal_signal+0x493)[0x675803]
/lib64/libpthread.so.0[0x3f2220f710]
/lib64/libc.so.6(gsignal+0x35)[0x3f21e32625]
/lib64/libc.so.6(abort+0x175)[0x3f21e33e05]
/usr/libexec/mysqld[0x84e808]
/usr/libexec/mysqld[0x8acede]
/usr/libexec/mysqld[0x886e65]
/usr/libexec/mysqld[0x87f6cf]
/usr/libexec/mysqld[0x830d5a]
/usr/libexec/mysqld[0x7fc810]
/usr/libexec/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x678451]
/usr/libexec/mysqld[0x58e088]
/usr/libexec/mysqld(_Z11plugin_initPiPPci+0x928)[0x591c78]
/usr/libexec/mysqld[0x518578]
/usr/libexec/mysqld(_Z11mysqld_mainiPPc+0x3fd)[0x51b73d]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3f21e1ed5d]
/usr/libexec/mysqld[0x511345]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
有谁知道为什么?
这是我的/etc/my.cnf:
[mysqld]
event_scheduler=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip_name_resolve = off
open_files_limit = 65536
max_allowed_packet = 1073741824
expire_logs_days = 2
binlog_format = row
innodb_file_per_table = 1
innodb_flush_method=O_DIRECT
innodb_buffer_pool_instances = 16
innodb_buffer_pool_size = 43G
innodb_thread_concurrency = 0
log-bin=mysql-bin
server-id=1
innodb_flush_log_at_trx_commit=1
slave-skip-errors = 1062,1032
max_connections=3600
connect_timeout=60
#wait_timeout=2400
#28/07/2015/ 12:42
back_log=4096
thread_cache_size=48
symbolic-links=0
user=mysql
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
!includedir /etc/my.cnf.d
#04/08/2015 10:23
wait_timeout=60
并在SHOW VARIABLES上显示配置:
innodb_additional_mem_pool_size 8388608
innodb_autoextend_increment 8
innodb_autoinc_lock_mode 1
innodb_buffer_pool_instances 16
innodb_buffer_pool_size 46170898432
thread_cache_size 48
max_connections 3600
innodb_log_buffer_size 8388608
join_buffer_size 131072
key_buffer_size 8388608
感谢您的帮助!
使用free -g:
的结果进行了更新free -g
total used free shared buffers cached
Mem: 62 62 0 0 0 15
-/+ buffers/cache: 47 15
Swap: 0 0 0
答案 0 :(得分:0)
如果你有swappiness = 0,并且你有其他应用程序占用几GB,那么你可能没有RAM。
推荐swappiness = 1。
不要试图分配太多;与具有较小的buffer_pool相比,交换会损害性能远远多于。