2015-08-20 28 views
1

我有一個64GB的RAM服務器,並想分配54GB的MySQL innodb緩衝池。但是,我發現我不能分配超過43GB的RAM和MySQL拋出這個錯誤:Mysql innodb緩衝池不能分配超過43G

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變量的配置:

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 

感謝您的幫助!

提供免費-g的結果更新:

free -g 
      total  used  free  shared buffers  cached 
Mem:   62   62   0   0   0   15 
-/+ buffers/cache:   47   15 
Swap:   0   0   0 
+1

據我所知沒有最大值。限制,但你試圖設置超過物理內存(所有分配的ram innodb_buffer_pool_size和其他變量,因爲你的連接),所以如果你分享你my.cnf /配置文件,那麼有人可以幫助你。 –

+0

顯示'free -g'。另外,分配多少錢用於交換? – akuzminsky

回答

0

如果你有swappiness = 0,如果您有其他應用程序佔用了幾個GB,那麼你就出局的RAM。

推薦swappiness = 1.

不要試圖分配太多;交換會損害性能更多比具有更小的buffer_pool。