Skip to main content

Mysql large number of running threads, causing hangs

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! From that output, my concerns would be the number of queries per second and if your server can handle that, and the number of open tables. Can you run this on the command line and paste the output here? mysql -e "show variables like '%open%';"
    0
  • Chirag Aggarwal
    Hey there! From that output, my concerns would be the number of queries per second and if your server can handle that, and the number of open tables. Can you run this on the command line and paste the output here? mysql -e "show variables like '%open%';"

    # mysql -e "show variables like '%open%';" +----------------------------+---------+ | Variable_name | Value | +----------------------------+---------+ | have_openssl | YES | | innodb_open_files | 4000 | | open_files_limit | 1048576 | | table_open_cache | 4000 | | table_open_cache_instances | 16 | +----------------------------+---------+
    Server has these queries avg during regular time period as well and it works. Specs are pretty good AMD EPYC 7302P with 128GB ram.
    0
  • cPRex Jurassic Moderator
    I'm just wondering if you're hitting that open tables limit and then that's when the slowness happens.
    0
  • Chirag Aggarwal
    I'm just wondering if you're hitting that open tables limit and then that's when the slowness happens.

    Now that I think about it, there were errors related to mysql hitting these limits some weeks ago but we set it to 1048576 which should be lot more than required. Normal usage is only around 2000. Error hasn't reappeared since in logs. Do you think I should still try increasing it further? Also, I tried that before and it threw this error: 2022-08-05T11:52:37.122007Z 0 [Warning] [MY-010140] [Server] Could not increase number of max_open_files to more than 1048576 (request: 9999999)
    # grep -i limit /etc/systemd/system/mysql.service # but not limited to OpenSSL) that is licensed under separate terms, # Sets open_files_limit LimitNOFILE = 10000
    0
  • cPRex Jurassic Moderator
    I mean, I wouldn't go too crazy, but 10000 seems reasonable.
    0
  • Chirag Aggarwal
    I mean, I wouldn't go too crazy, but 10000 seems reasonable.

    I guess my.cnf is overriding that to 1048576. So it shouldn't be the cause of problem right? Anything else I can check?
    0
  • cPRex Jurassic Moderator
    That was the open files limit, and the 4000 value was the open tables, which is the "table_open_cache" value from that earlier command.
    0

Please sign in to leave a comment.