V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
nellace
V2EX  ›  MySQL

MySQL5.7 内存一直好高,

  •  
  •   nellace · 2016-04-08 15:48:23 +08:00 · 10078 次点击
    这是一个创建于 2932 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ![]( )
    centos7 1g 内存装了 mysql5.7 ,配置
    [client]
    default-character-set = utf8

    [mysqld]
    #performance_schema_max_table_instances=200
    table_open_cache = 200
    default-storage-engine = INNODB
    character-set-server = utf8
    collation-server = utf8_general_ci

    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock

    symbolic-links=0

    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    [mysqldump]
    quick
    max_allowed_packet = 8M #服务器发送和接受的最大包长度

    [myisamchk]
    key_buffer_size = 4M
    sort_buffer_size = 4M
    read_buffer = 2M
    write_buffer = 2M

    不知道怎么解决
    22 条回复    2016-09-22 00:27:06 +08:00
    colorfulberry
        1
    colorfulberry  
       2016-04-08 15:55:56 +08:00
    postgres sql 可以用的
    xuhaoyangx
        2
    xuhaoyangx  
       2016-04-08 16:02:19 +08:00
    这好像不是老问题吗
    performance_schema_max_table_instances
    table_definition_cache
    table_open_cache
    调低点值就好了
    xuhaoyangx
        3
    xuhaoyangx  
       2016-04-08 16:09:37 +08:00   ❤️ 1
    虽然系统不一样,但是这方面都差不多吧,我这个是 etc 配置中就只设定了 sql_mode 的值。
    kn007
        5
    kn007  
       2016-04-08 17:14:18 +08:00
    把初始配置调低不就好了。
    nellace
        6
    nellace  
    OP
       2016-04-08 18:58:11 +08:00 via iPhone
    @kn007
    @xuhaoyangx 你看我配置文件里这三个参数都调低了 还是不行
    kn007
        7
    kn007  
       2016-04-08 18:59:27 +08:00
    @nellace 你配置贴哪里了?!

    把 innodb 参数调低来。
    xujif
        8
    xujif  
       2016-04-08 19:05:36 +08:00
    mysql 版本越高越费内存啊
    nellace
        9
    nellace  
    OP
       2016-04-08 19:25:36 +08:00 via iPhone
    @kn007 嗯 好的 帖子里面贴了 my.cnf 配置文件的内容 排版不太好 看看有什么要改的吗
    nellace
        10
    nellace  
    OP
       2016-04-08 19:26:31 +08:00 via iPhone
    @xujif 本来想体验下 5.7 不行就退回去 5.5 了
    kn007
        11
    kn007  
       2016-04-08 19:27:09 +08:00   ❤️ 1
    @nellace 你帖子里的 conf ,都没动到 innodb 。
    把 innodb 参数调低来,自己 google 。
    tcdw
        12
    tcdw  
       2016-04-08 19:39:02 +08:00 via Android
    顺便推荐使用 htop ,比 top 功能丰富,而且界面看上去比较友好。
    当然如果是不喜欢 htop 之类的,可以另当别论。
    gamexg
        13
    gamexg  
       2016-04-08 20:08:24 +08:00
    @xuhaoyangx 原来还能限制数量,我是直接 performance_schema=OFF 。
    gamexg
        14
    gamexg  
       2016-04-08 20:11:35 +08:00   ❤️ 1
    楼主,你 #performance_schema_max_table_instances=200 注释掉了啊,这个是一个占内存很大的项目,我记得测试时占 500M 内存。
    我一般直接关闭这个:
    [mysqld]
    performance_schema=OFF
    shengyueming
        15
    shengyueming  
       2016-04-09 09:38:51 +08:00   ❤️ 1
    for (说三遍){
    postgres 不错
    }
    nellace
        16
    nellace  
    OP
       2016-04-09 10:30:00 +08:00
    @gamexg 本来是要开着的,刚刚注释掉了
    nellace
        17
    nellace  
    OP
       2016-04-09 10:36:09 +08:00
    @shengyueming 今天撸一下 postgre ,以前没用过
    overlords
        18
    overlords  
       2016-04-09 11:59:56 +08:00
    内存还值钱么?
    letitbesqzr
        19
    letitbesqzr  
       2016-04-09 13:50:25 +08:00
    @xuhaoyangx 请问你那个 iTerm2 是什么配色?
    xuhaoyangx
        20
    xuhaoyangx  
       2016-04-10 01:54:13 +08:00
    wanghanlin
        21
    wanghanlin  
       2016-04-10 17:49:39 +08:00
    tcsky
        22
    tcsky  
       2016-09-22 00:27:06 +08:00
    ```
    [mysqld]
    performance_schema = 0
    ```

    performance_schema 这个选项式分析用的,小内存机器可以关了, 能省好多内存

    https://gist.github.com/tiancheng91/c9b605cd7cdd363c75a1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4763 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:50 · PVG 17:50 · LAX 02:50 · JFK 05:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.