ดูใน hostname.err
091126 11:05:04 InnoDB: Error: cannot allocate 12884918272 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 53796176 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...
InnoDB: Fatal error: cannot allocate the memory for the buffer pool
เปลี่ยนแปลงค่า ulimits ใน /etc/init.d/mysql จาก 20000 เป็น 30000
ได้กำหนดค่าใน /etc/security/limits.conf แล้วตั้งแต่เพิ่ม RAM
root soft nofile 30000
root hard nofile 30000
mysql soft nofile 30000
mysql hard nofile 30000
1. centos 64bit หรือ 32bit
2. max_connection = 2000
ที่โรงพยาบาล network บ่อยๆๆ หรือเปล่าครับ
ถ้าไม่บ่อย ลดลง 500 ก็พอครับ
เจอทาง msn หรือ chart hosxp
CentOS 5.4 64 bit
max_Connection=2000
my.cnf
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
default-storage-engine = INNODB
default-character-set=tis620
skip-name-resolve
skip-character-set-client-handshake
init_connect = 'SET NAMES tis620'
max-connection = 2000
concurrent_insert = 2
table_cache = 2048
max_allowed_packet = 1G
max_heap_table_size = 2G
key_buffer = 1024M
sort_buffer_size = 4M
read_buffer_size = 4M
read_rnd_buffer_size = 4M
join_buffer_size = 8M
myisam_sort_buffer_size = 2G
thread_cache = 8
query_cache_size= 2G
thread_concurrency = 8
skip-federated
server_id=1
innodb_file_per_table
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
innodb_buffer_pool_size = 12G
innodb_additional_mem_pool_size = 24M
innodb_log_file_size = 256M
innodb_log_buffer_size = 20M
innodb_flush_log_at_trx_commit = 2
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_thread_concurrency = 0
innodb_support_xa=0
innodb_open_files = 3000
innodb_locks_unsafe_for_binlog=1
innodb_flush_method=O_DIRECT
innodb_doublewrite=0
#innodb_adaptive_checkpoint = 1
#innodb_io_capacity = 1000
#innodb_write_io_threads = 16
#innodb_read_io_threads = 16
[mysqldump]
quick
max_allowed_packet = 2G
allow-keywords
[mysql]
no-auto-rehash
default-character-set=tis620
[isamchk]
key_buffer = 1024M
sort_buffer_size = 1024M
read_buffer = 16M
write_buffer = 16M
[myisamchk]
key_buffer = 1024M
sort_buffer_size = 1024M
read_buffer = 16M
write_buffer = 16M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]