当前位置:首页 > MySQL

MY SQL configuration

canca13年前 (2013-06-10)MySQL508

ASK:

We have a database Server Configuration:
4GB RAM
600GB Hard Disk
Xeon Processor 1.3 Ghz.

We are barely able to have 100 concurrent users!!! What are we doing wrong.

I know I need to configure mysql_query cache, mysql_limit_size and table_cache. But what should be the formula, and how do we go about checking the same.

Below is the details of our my.ini file.

[mysqld]
datadir=/database/data
socket=/var/lib/mysql/mysql.sock
set-variable=max_connections=2000
set-variable = max_allowed_packet=64M
default-storage-engine = innodb
log-bin=/database/data/mysql-bin

old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Answer:

Try this configuration and read my comments inside it

#you really don't need more than 200 connections
max_connections = 200  

#this can be safely reduced to 32 or even 16M if you have few (0-20) or small (<1gb total) databases
key_buffer = 128M 

myisam_sort_buffer_size = 32M
join_buffer_size = 2M
read_buffer_size = 1M
sort_buffer_size = 8M

#use total number of database tables +20%  (ALL databases) - if you just have a single drupal database 100-150 will be enough
table_cache = 2000 

thread_cache_size = 32
wait_timeout = 3600
connect_timeout = 4
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M

#if you get a long query selecting a lot of data you might want to increase this
query_cache_limit = 32M

#play with this until you get 80% cache filled after mysql server has been running for 24h+, if this is a dedicated database server you can go nuts with this up to 70% of RAM, but it there is no queries to be cached this will be pretty useless. Better stay under 512M and use rest for memcached
query_cache_size = 96M

query_cache_type = 1
query_prealloc_size = 65536
query_alloc_block_size = 131072
open_files_limit = 8196

key_buffer_size         = 64M
thread_stack            = 128K

add the rest of the config (user, pid, passwords, etc) from you current configuration

If you can't handle it on your own, or need someone to fine tune the settings let me know - I'll have a look.


Refer:https://groups.drupal.org/node/13844

扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/140.html

标签: MySQL
分享给朋友:

“MY SQL configuration” 的相关文章

mysql 配置命令大全

--auto-rehash       Enable automatic rehashing. One doesn't need to use             …

MySql导入SQL文件

MySql导入SQL文件: mysql -u root -p <c:\sampledb.sql…

MySQL建立远程登陆用户

如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server 解决方法: 1. 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要…

MySQL备份与恢复语句

mysql备份语句:E:\MySQL Server 5.0\bin>mysqldump -uroot -padmin --default-character-set=utf8 --opt --extended-insert=false --triggers -R --hex-blob -x s…

Mysql中触发器的使用

在SQL中,名词触发器指“在数据库中为响应一个特殊表格中的某些事件而自动执行的程序代码。”(Wikipedia)说得简单一些,它是在一个特殊的数据库事件,如INSERT或DELETE发生时,自动激活的一段代码。触发器可方便地用...…

MYSQL用户权限管理

MYSQL 用户管理 1.权限表MYSQL是一个多用户的数据库,MYSQL的用户可以分为两大类:(1)       超级管理员用户(root),拥有全部权限(2)     …

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。