找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 74|回复: 10

谁给个优化好的512以上的my.cnf啊

[复制链接]

25

主题

101

回帖

287

积分

中级会员

积分
287
发表于 2010-3-19 03:27:51 | 显示全部楼层 |阅读模式
天啊所有的一键包都是针对128优化的。。。。限制的死死的对于菜鸟的我来说太难了。。。谁给个配置好的512-1g的配置文件啊
回复

使用道具 举报

246

主题

3360

回帖

7520

积分

论坛元老

积分
7520
发表于 2010-3-19 06:02:56 | 显示全部楼层
同求
回复

使用道具 举报

11

主题

142

回帖

333

积分

中级会员

积分
333
发表于 2010-3-19 08:21:11 | 显示全部楼层
一起支持同求
回复

使用道具 举报

283

主题

6413

回帖

1万

积分

论坛元老

积分
13735
发表于 2010-3-19 08:42:00 | 显示全部楼层
回复

使用道具 举报

67

主题

1994

回帖

4205

积分

论坛元老

积分
4205
发表于 2010-3-19 09:39:02 | 显示全部楼层
新版本已经添加简易的增加多站点脚本了,命令是: ./host.sh
你去看看吧

mysql优化还是靠自己的,128的优化只是优化内存小点,而不是优化性能的
回复

使用道具 举报

67

主题

1994

回帖

4205

积分

论坛元老

积分
4205
发表于 2010-3-19 09:39:49 | 显示全部楼层
[ol]
  • # Example MySQL config file for large systems.
  • #
  • # This is for a large system with memory = 512M where the system runs mainly
  • # MySQL.
  • #
  • # You can copy this file to
  • # /etc/my.cnf to set global options,
  • # mysql-data-dir/my.cnf to set server-specific options (in this
  • # installation this directory is /usr/local/mysql/var) or
  • # ~/.my.cnf to set user-specific options.
  • #
  • # In this file, you can use all long options that a program supports.
  • # If you want to know which options a program supports, run the program
  • # with the "--help" option.
  • # The following options will be passed to all MySQL clients
  • [client]
  • #password        = your_password
  • port                = 3306
  • socket                = /tmp/mysql.sock
  • # Here follows entries for some specific programs
  • # The MySQL server
  • [mysqld]
  • port                = 3306
  • socket                = /tmp/mysql.sock
  • skip-locking
  • key_buffer_size = 256M
  • max_allowed_packet = 1M
  • table_open_cache = 256
  • sort_buffer_size = 1M
  • read_buffer_size = 1M
  • read_rnd_buffer_size = 4M
  • myisam_sort_buffer_size = 64M
  • thread_cache_size = 8
  • query_cache_size= 16M
  • # Try number of CPU's*2 for thread_concurrency
  • thread_concurrency = 8
  • # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  • # if all processes that need to connect to mysqld run on the same host.
  • # All interaction with mysqld must be made via Unix sockets or named pipes.
  • # Note that using this option without enabling named pipes on Windows
  • # (via the "enable-named-pipe" option) will render mysqld useless!
  • #
  • #skip-networking
  • # Replication Master Server (default)
  • # binary logging is required for replication
  • log-bin=mysql-bin
  • # binary logging format - mixed recommended
  • binlog_format=mixed
  • # required unique id between 1 and 2^32 - 1
  • # defaults to 1 if master-host is not set
  • # but will not function as a master if omitted
  • server-id        = 1
  • # Replication Slave (comment out master section to use this)
  • #
  • # To configure this host as a replication slave, you can choose between
  • # two methods :
  • #
  • # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  • #    the syntax is:
  • #
  • #    CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,
  • #    MASTER_USER=, MASTER_PASSWORD= ;
  • #
  • #    where you replace , ,  by quoted strings and
  • #     by the master's port number (3306 by default).
  • #
  • #    Example:
  • #
  • #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  • #    MASTER_USER='joe', MASTER_PASSWORD='secret';
  • #
  • # OR
  • #
  • # 2) Set the variables below. However, in case you choose this method, then
  • #    start replication for the first time (even unsuccessfully, for example
  • #    if you mistyped the password in master-password and the slave fails to
  • #    connect), the slave will create a master.info file, and any later
  • #    change in this file to the variables' values below will be ignored and
  • #    overridden by the content of the master.info file, unless you shutdown
  • #    the slave server, delete master.info and restart the slaver server.
  • #    For that reason, you may want to leave the lines below untouched
  • #    (commented) and instead use CHANGE MASTER TO (see above)
  • #
  • # required unique id between 2 and 2^32 - 1
  • # (and different from the master)
  • # defaults to 2 if master-host is set
  • # but will not function as a slave if omitted
  • #server-id       = 2
  • #
  • # The replication master for this slave - required
  • #master-host     =   
  • #
  • # The username the slave will use for authentication when connecting
  • # to the master - required
  • #master-user     =   
  • #
  • # The password the slave will authenticate with when connecting to
  • # the master - required
  • #master-password =   
  • #
  • # The port the master is listening on.
  • # optional - defaults to 3306
  • #master-port     =  
  • #
  • # binary logging - not required for slaves, but recommended
  • #log-bin=mysql-bin
  • # Point the following paths to different dedicated disks
  • #tmpdir                = /tmp/               
  • #log-update         = /path-to-dedicated-directory/hostname
  • # Uncomment the following if you are using InnoDB tables
  • #innodb_data_home_dir = /usr/local/mysql/var/
  • #innodb_data_file_path = ibdata1:10M:autoextend
  • #innodb_log_group_home_dir = /usr/local/mysql/var/
  • # You can set .._buffer_pool_size up to 50 - 80 %
  • # of RAM but beware of setting memory usage too high
  • #innodb_buffer_pool_size = 256M
  • #innodb_additional_mem_pool_size = 20M
  • # Set .._log_file_size to 25 % of buffer pool size
  • #innodb_log_file_size = 64M
  • #innodb_log_buffer_size = 8M
  • #innodb_flush_log_at_trx_commit = 1
  • #innodb_lock_wait_timeout = 50
  • [mysqldump]
  • quick
  • max_allowed_packet = 16M
  • [mysql]
  • no-auto-rehash
  • # Remove the next comment character if you are not familiar with SQL
  • #safe-updates
  • [myisamchk]
  • key_buffer_size = 128M
  • sort_buffer_size = 128M
  • read_buffer = 2M
  • write_buffer = 2M
  • [mysqlhotcopy]
  • interactive-timeout[/ol]复制代码
  • 回复

    使用道具 举报

    147

    主题

    2099

    回帖

    4697

    积分

    论坛元老

    积分
    4697
    发表于 2010-3-19 11:43:22 | 显示全部楼层
    楼主 修改这2个位置,就好明显了:

    # The MySQL server
    [mysqld]
    skip-locking
    key_buffer_size = 256M
    table_open_cache = 256

    我256M的,keyburffersize我设置是4M (小内存好多设置成16k,差别太大)
    table这个,我设置成64,应该来说64足够了

    这样弄下来,内存占用还不错,而且性能也OK,楼主可以细细调节以上2个参数,慢慢看看对网站影响大不大
    回复

    使用道具 举报

    115

    主题

    430

    回帖

    1243

    积分

    金牌会员

    积分
    1243
    发表于 2010-3-19 12:39:26 | 显示全部楼层
    直接用默认的 share/mysql/my-medium.cnf

    覆盖到 /etc/my.cnf 下

    应该行..
    回复

    使用道具 举报

    365

    主题

    1440

    回帖

    4035

    积分

    论坛元老

    积分
    4035
    发表于 2010-3-19 13:36:13 | 显示全部楼层
    [ol]
  • [client]
  • character-set-server = utf8
  • port    = 3306
  • socket  = /tmp/mysql.sock
  • [mysqld]
  • character-set-server = utf8
  • replicate-ignore-db = mysql
  • replicate-ignore-db = test
  • replicate-ignore-db = information_schema
  • user    = mysql
  • port    = 3306
  • socket  = /tmp/mysql.sock
  • basedir = /usr/local/webserver/mysql
  • datadir = /data0/mysql/3306/data
  • log-error = /data0/mysql/3306/mysql_error.log
  • pid-file = /data0/mysql/3306/mysql.pid
  • open_files_limit    = 10240
  • back_log = 600
  • max_connections = 5000
  • max_connect_errors = 6000
  • table_cache = 614
  • external-locking = FALSE
  • max_allowed_packet = 32M
  • sort_buffer_size = 1M
  • join_buffer_size = 1M
  • thread_cache_size = 300
  • thread_concurrency = 8
  • query_cache_size = 512M
  • query_cache_limit = 2M
  • query_cache_min_res_unit = 2k
  • default-storage-engine = MyISAM
  • thread_stack = 192K
  • transaction_isolation = READ-COMMITTED
  • tmp_table_size = 246M
  • max_heap_table_size = 246M
  • long_query_time = 3
  • log-slave-updates
  • log-bin = /data0/mysql/3306/binlog/binlog
  • binlog_cache_size = 4M
  • binlog_format = MIXED
  • max_binlog_cache_size = 8M
  • max_binlog_size = 1G
  • relay-log-index = /data0/mysql/3306/relaylog/relaylog
  • relay-log-info-file = /data0/mysql/3306/relaylog/relaylog
  • relay-log = /data0/mysql/3306/relaylog/relaylog
  • expire_logs_days = 30
  • key_buffer_size = 256M
  • read_buffer_size = 1M
  • read_rnd_buffer_size = 16M
  • bulk_insert_buffer_size = 64M
  • myisam_sort_buffer_size = 128M
  • myisam_max_sort_file_size = 10G
  • myisam_repair_threads = 1
  • myisam_recover
  • interactive_timeout = 120
  • wait_timeout = 120
  • skip-name-resolve
  • master-connect-retry = 10
  • slave-skip-errors = 1032,1062,126,1114,1146,1048,1396
  • #master-host     =   192.168.1.2
  • #master-user     =   username
  • #master-password =   password
  • #master-port     =  3306
  • server-id = 1
  • innodb_additional_mem_pool_size = 16M
  • innodb_buffer_pool_size = 512M
  • innodb_data_file_path = ibdata1:256M:autoextend
  • innodb_file_io_threads = 4
  • innodb_thread_concurrency = 8
  • innodb_flush_log_at_trx_commit = 2
  • innodb_log_buffer_size = 16M
  • innodb_log_file_size = 128M
  • innodb_log_files_in_group = 3
  • innodb_max_dirty_pages_pct = 90
  • innodb_lock_wait_timeout = 120
  • innodb_file_per_table = 0
  • #log-slow-queries = /data0/mysql/3306/slow.log
  • #long_query_time = 10
  • [mysqldump]
  • quick
  • max_allowed_packet = 32M[/ol]复制代码张宴的.
    有些需要自己修改.
  • 回复

    使用道具 举报

    0

    主题

    28

    回帖

    66

    积分

    注册会员

    积分
    66
    发表于 2010-3-19 13:45:40 | 显示全部楼层
    这玩意太复杂,等你们搞定先。



    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-1-12 09:50 , Processed in 0.024099 second(s), 5 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表