Can i increase table_open_cache value without worries?

Discussion in 'MySQL' started by postcd, Sep 28, 2015.

  1. #1
    Hello, i found i have these values in mysql:

    mysql> show global status like 'open%';
    +--------------------------+----------+
    | Variable_name | Value |
    +--------------------------+----------+
    | Open_files | 1101 |
    | Open_streams | 0 |
    | Open_table_definitions | 723 |
    | Open_tables | 728 |
    | Opened_files | 13114006 |
    | Opened_table_definitions | 7276634 |
    | Opened_tables | 3825856 |
    +--------------------------+----------+

    In this article, author suggested it can be good idea to calculate proper Table_open_cache value this way:

    Table_open_cache = total_tables*Threads_connected

    I see i have 13658 total tables in databases and around 10 threads at a time, so should i set Table_open_cache to this value safely?

    140000 (140,000)

    cant happen that server fatally fail because of no RAM or no SWAP (i have vswap) ? Thx

    Update: mysql says this:
    So "MySQL may run out of file descriptors and refuse connections, fail to perform queries, and be very unreliable." if i set it too high.. but how to discover what value is too high?

    # cat /proc/sys/fs/file-max
    2451492

    my filesystem
    # df | grep -v virtfs
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/simfs 358400000 223243064 135156936 63% /
     
    Last edited: Sep 28, 2015
    postcd, Sep 28, 2015 IP