Recently i upgraded to MariaDB 10.3.10 using directadmin custombuild function. And i noticed the mysql performance not very good. and while checking mysqltuner.pl suggestion, i found the number open file limit used extremely high.
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 78.0M (Tables: 5)
[--] Data in InnoDB tables: 21.1G (Tables: 236)
[--] Data in MEMORY tables: 10.8M (Tables: 3)
[!!] Total fragmented tables: 1
-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 14h 11m 59s (52M q [1K qps], 3M conn, TX: 1503G, RX: 15G)
[--] Reads / Writes: 75% / 25%
[--] Binary logging is disabled
[--] Physical Memory : 94.2G
[--] Max MySQL memory : 37.4G
[--] Other process memory: 611.8M
[--] Total buffers: 35.1G global + 2.9M per thread (620 max threads)
[--] P_S Max memory usage: 531M
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 35.7G (37.94% of installed RAM)
[OK] Maximum possible memory usage: 37.4G (39.68% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/52M)
[OK] Highest usage of available connections: 7% (45/620)
[OK] Aborted connections: 0.00% (0/3451781)
[--] Skipped name resolution test due to skip_networking=ON in system variables.
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (78 temp sorts / 3M sorts)
[!!] Joins performed without indexes: 837224
[!!] Temporary tables created on disk: 50% (1M on disk / 3M total)
[OK] Thread cache hit rate: 99% (45 created / 3M connections)
[OK] Table cache hit rate: 90% (667 open / 735 opened)
*[!!] Open file limit used: 28147927174348900% (18446744073B/65K)
*[!!] Table locks acquired immediately: 86%
-------- Performance schema ------------------------------------------------------------------------
[--] Memory used by P_S: 531.1M
[--] Sys schema isn't installed.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 36 thread(s).
[--] Using default value is good enough for your version (10.3.10-MariaDB)
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 19.5% (516M used / 2B cache)
[OK] Key buffer size / total MyISAM indexes: 2.5G/16.8M
[OK] Read Key buffer hit rate: 100.0% (98M cached / 10K reads)
[!!] Write Key buffer hit rate: 88.3% (7M cached / 6M writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 32.0G/21.1G
[OK] Ratio InnoDB log file size / InnoDB Buffer pool size: 4.0G * 2/32.0G should be equal 25%
[OK] InnoDB buffer pool instances: 32
[--] Number of InnoDB Buffer Pool Chunk : 256 for 32 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (36999275046 hits/ 37000117624 total)
[!!] InnoDB Write Log efficiency: 86.04% (3658360 hits/ 4251694 total)
[OK] InnoDB log waits: 0.00% (0 waits / 593334 writes)
-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B
[OK] Aria pagecache hit rate: 98.5% (106M cached / 1M reads)
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.
-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: MIXED
[--] XA support enabled: ON
[--] Semi synchronous replication Master: OFF
[--] Semi synchronous replication Slave: OFF
[--] This is a standalone server
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
OPTIMIZE TABLE admin_xxxxx.`xf_search`; – can free 37 MB
Total freed space after theses OPTIMIZE TABLE : 37 Mb
MySQL was started within the last 24 hours - recommendations may be inaccurate
Adjust your join queries to always utilize indexes
Temporary table size is already large - reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses
Optimize queries and/or use InnoDB to reduce lock wait
Consider installing Sys schema from https://github.com/mysql/mysql-sys
Variables to adjust:
join_buffer_size (> 256.0K, or always use indexes with JOINs)
open_files_limit (> 65535)
{"report":{"fcp":866.5,"ttfb":250.29999995231628,"pageVisibility":"visible","entityId":71073,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"b295bfef-2521-484b-8c8a-a3f13aa64a5b","navigationType":0,"readyForUser":937.5999999046326,"redirectCount":0,"resourceLoadedEnd":621.7000000476837,"resourceLoadedStart":255.89999985694885,"resourceTiming":[{"duration":19.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":255.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":275.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":19.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":256.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":276,"responseStart":0,"secureConnectionStart":0},{"duration":184.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":256.2999999523163,"connectEnd":256.2999999523163,"connectStart":256.2999999523163,"domainLookupEnd":256.2999999523163,"domainLookupStart":256.2999999523163,"fetchStart":256.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":279.39999985694885,"responseEnd":440.7999999523163,"responseStart":309,"secureConnectionStart":256.2999999523163},{"duration":304.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":256.39999985694885,"connectEnd":256.39999985694885,"connectStart":256.39999985694885,"domainLookupEnd":256.39999985694885,"domainLookupStart":256.39999985694885,"fetchStart":256.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":281.59999990463257,"responseEnd":561,"responseStart":333.2999999523163,"secureConnectionStart":256.39999985694885},{"duration":59.299999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":256.5,"connectEnd":256.5,"connectStart":256.5,"domainLookupEnd":256.5,"domainLookupStart":256.5,"fetchStart":256.5,"redirectEnd":0,"redirectStart":0,"requestStart":282.09999990463257,"responseEnd":315.7999999523163,"responseStart":314,"secureConnectionStart":256.5},{"duration":59.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":256.59999990463257,"connectEnd":256.59999990463257,"connectStart":256.59999990463257,"domainLookupEnd":256.59999990463257,"domainLookupStart":256.59999990463257,"fetchStart":256.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":283.09999990463257,"responseEnd":316.09999990463257,"responseStart":314.59999990463257,"secureConnectionStart":256.59999990463257},{"duration":62.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":256.7000000476837,"connectEnd":256.7000000476837,"connectStart":256.7000000476837,"domainLookupEnd":256.7000000476837,"domainLookupStart":256.7000000476837,"fetchStart":256.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":283.59999990463257,"responseEnd":319.39999985694885,"responseStart":318.09999990463257,"secureConnectionStart":256.7000000476837},{"duration":24.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":256.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.5,"responseStart":0,"secureConnectionStart":0},{"duration":25.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":256.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":282.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":122.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":256.89999985694885,"connectEnd":256.89999985694885,"connectStart":256.89999985694885,"domainLookupEnd":256.89999985694885,"domainLookupStart":256.89999985694885,"fetchStart":256.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":284.39999985694885,"responseEnd":379.59999990463257,"responseStart":378.2999999523163,"secureConnectionStart":256.89999985694885},{"duration":64.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":257.09999990463257,"connectEnd":257.09999990463257,"connectStart":257.09999990463257,"domainLookupEnd":257.09999990463257,"domainLookupStart":257.09999990463257,"fetchStart":257.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":285.7000000476837,"responseEnd":321.39999985694885,"responseStart":319.7000000476837,"secureConnectionStart":257.09999990463257},{"duration":306,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":257.59999990463257,"connectEnd":257.59999990463257,"connectStart":257.59999990463257,"domainLookupEnd":257.59999990463257,"domainLookupStart":257.59999990463257,"fetchStart":257.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":539.0999999046326,"responseEnd":563.5999999046326,"responseStart":562.8999998569489,"secureConnectionStart":257.59999990463257},{"duration":359.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":262.09999990463257,"connectEnd":262.09999990463257,"connectStart":262.09999990463257,"domainLookupEnd":262.09999990463257,"domainLookupStart":262.09999990463257,"fetchStart":262.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":609.2999999523163,"responseEnd":621.7000000476837,"responseStart":621.2000000476837,"secureConnectionStart":262.09999990463257},{"duration":83.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":564.8999998569489,"connectEnd":564.8999998569489,"connectStart":564.8999998569489,"domainLookupEnd":564.8999998569489,"domainLookupStart":564.8999998569489,"fetchStart":564.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":613.5999999046326,"responseEnd":648.2999999523163,"responseStart":647.7999999523163,"secureConnectionStart":564.8999998569489}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":48,"responseStart":251,"responseEnd":258,"domLoading":254,"domInteractive":1004,"domContentLoadedEventStart":1004,"domContentLoadedEventEnd":1054,"domComplete":1632,"loadEventStart":1632,"loadEventEnd":1633,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":971.5999999046326},{"name":"bigPipe.sidebar-id.end","time":972.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":972.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":975.5999999046326},{"name":"activityTabFullyLoaded","time":1072.8999998569489}],"measures":[],"correlationId":"b3ebb488dbb079","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":122,"dbReadsTimeInMs":11,"dbConnsTimeInMs":38,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I am monitoring db status by nagios. Here is some statistics:
db restart
48 minutes normal
23 hours high
6 minutes normal
6 minutes high
5 hours normal
2 minutes high
12 minute normal
6 minutes high
4 minutes normal
2 minutes high
3 hours normal
6 hours high
Now it's
show global status like 'open_files';
flush status doesn't have any effect.