分类: Mysql/postgreSQL
2013-09-03 16:21:38
原文地址:估算mysql使用内存公式 作者:xyaxlz
On 32-bit GNU/Linux x86, you must be careful not to set memory usage too high. glibc may permit the process heap to grow over thread stacks, which crashes your server. It is a risk if the value of the following expression is close to or exceeds 2GB:
innodb_buffer_pool_size + key_buffer_size + max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size) + max_connections*2MBEach thread uses a stack (often 2MB, but only 256KB in MySQL binaries provided by Oracle Corporation.) and in the worst case also uses sort_buffer_size + read_buffer_size additional memory.
By compiling MySQL yourself, you can use up to 64GB of physical memory in 32-bit Windows. See the description for innodb_buffer_pool_awe_mem_mb in Section 13.2.3, “InnoDB Startup Options and System Variables”.
http://dev.mysql.com/doc/refman/5.5/en/innodb-configuration.html