The cli maxctrl command list servers does not show the Connections correctly AND State Master is very strange in SchemaRouter sharding system where IMHO all shards should be treated equally. And maxscale keeps too many connections open.
In the following example we have application 6 Connections open:
2 to shard 1
3 to shard 2
1 to shard 3
root@ubu2204-max:/tmp# maxctrl list services
|
┌─────────────────┬──────────────┬─────────────┬───────────────────┬────────────────────────┐
|
│ Service │ Router │ Connections │ Total Connections │ Targets │
|
├─────────────────┼──────────────┼─────────────┼───────────────────┼────────────────────────┤
|
│ Sharded-Service │ schemarouter │ 6 │ 6 │ shard1, shard2, shard3 │
|
└─────────────────┴──────────────┴─────────────┴───────────────────┴────────────────────────┘
|
root@ubu2204-max:/tmp# maxctrl list servers
|
┌────────┬──────────────┬──────┬─────────────┬─────────────────┬───────────┬─────────────────┐
|
│ Server │ Address │ Port │ Connections │ State │ GTID │ Monitor │
|
├────────┼──────────────┼──────┼─────────────┼─────────────────┼───────────┼─────────────────┤
|
│ shard1 │ 10.139.158.1 │ 3363 │ 6 │ Master, Running │ 0-3363-42 │ MariaDB-Monitor │
|
├────────┼──────────────┼──────┼─────────────┼─────────────────┼───────────┼─────────────────┤
|
│ shard2 │ 10.139.158.1 │ 3364 │ 6 │ Running │ 0-3364-47 │ MariaDB-Monitor │
|
├────────┼──────────────┼──────┼─────────────┼─────────────────┼───────────┼─────────────────┤
|
│ shard3 │ 10.139.158.1 │ 3365 │ 6 │ Running │ 0-3365-37 │ MariaDB-Monitor │
|
└────────┴──────────────┴──────┴─────────────┴─────────────────┴───────────┴─────────────────┘
|
--> Master looks strange
And we have in total 18 connections open (SHOW PROCESSLIST):
show processlist;
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| Id | User | Host | db | Command | Time | State | Info | Progress |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| 33 | mysql | localhost | NULL | Query | 0 | starting | show processlist | 0.000 |
|
| 35 | maxscale | 10.139.158.211:41996 | NULL | Sleep | 0 | | NULL | 0.000 |
|
| 37 | app | 10.139.158.211:49234 | customer_0010 | Sleep | 316 | | NULL | 0.000 |
|
| 38 | app | 10.139.158.211:38886 | customer_0011 | Sleep | 296 | | NULL | 0.000 |
|
| 39 | app | 10.139.158.211:58320 | NULL | Sleep | 287 | | NULL | 0.000 |
|
| 40 | app | 10.139.158.211:40536 | NULL | Sleep | 282 | | NULL | 0.000 |
|
| 41 | app | 10.139.158.211:40538 | NULL | Sleep | 278 | | NULL | 0.000 |
|
| 43 | app | 10.139.158.211:50232 | NULL | Sleep | 269 | | NULL | 0.000 |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
|
show processlist;
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| Id | User | Host | db | Command | Time | State | Info | Progress |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| 32 | mysql | localhost | NULL | Query | 0 | starting | show processlist | 0.000 |
|
| 34 | maxscale | 10.139.158.211:51294 | NULL | Sleep | 1 | | NULL | 0.000 |
|
| 36 | app | 10.139.158.211:60042 | NULL | Sleep | 321 | | NULL | 0.000 |
|
| 37 | app | 10.139.158.211:37718 | NULL | Sleep | 301 | | NULL | 0.000 |
|
| 38 | app | 10.139.158.211:51646 | customer_0020 | Sleep | 292 | | NULL | 0.000 |
|
| 39 | app | 10.139.158.211:55992 | customer_0021 | Sleep | 287 | | NULL | 0.000 |
|
| 40 | app | 10.139.158.211:56006 | customer_0022 | Sleep | 282 | | NULL | 0.000 |
|
| 42 | app | 10.139.158.211:34016 | NULL | Sleep | 273 | | NULL | 0.000 |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
show processlist;
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| Id | User | Host | db | Command | Time | State | Info | Progress |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
| 32 | mysql | localhost | NULL | Query | 0 | starting | show processlist | 0.000 |
|
| 34 | maxscale | 10.139.158.211:56696 | NULL | Sleep | 0 | | NULL | 0.000 |
|
| 36 | app | 10.139.158.211:60772 | NULL | Sleep | 325 | | NULL | 0.000 |
|
| 37 | app | 10.139.158.211:39592 | NULL | Sleep | 305 | | NULL | 0.000 |
|
| 38 | app | 10.139.158.211:59874 | NULL | Sleep | 296 | | NULL | 0.000 |
|
| 39 | app | 10.139.158.211:39492 | NULL | Sleep | 291 | | NULL | 0.000 |
|
| 40 | app | 10.139.158.211:39500 | NULL | Sleep | 287 | | NULL | 0.000 |
|
| 42 | app | 10.139.158.211:45858 | customer_0030 | Sleep | 278 | | NULL | 0.000 |
|
+----+----------+----------------------+---------------+---------+------+----------+------------------+----------+
|
Much too many connections open. This will not scale well on a system with many tenants!!!
What IMHO is wrong:
1.) State: Master
2.) list servers: Connections should be 2,3,1 and not 3 x 6
3.) Too many connections open (see show processlist)
{"report":{"fcp":1315.4000000953674,"ttfb":320.40000009536743,"pageVisibility":"visible","entityId":127891,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"21266882-8242-4fba-b10e-2b5e9727e808","navigationType":0,"readyForUser":1430.7000002861023,"redirectCount":0,"resourceLoadedEnd":924.2000002861023,"resourceLoadedStart":389.59999990463257,"resourceTiming":[{"duration":111.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":389.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":389.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":111.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":390.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":390.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":391,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":390.30000019073486,"connectEnd":390.30000019073486,"connectStart":390.30000019073486,"domainLookupEnd":390.30000019073486,"domainLookupStart":390.30000019073486,"fetchStart":390.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":504.09999990463257,"responseEnd":781.3000001907349,"responseStart":523,"secureConnectionStart":390.30000019073486},{"duration":533.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":390.90000009536743,"connectEnd":390.90000009536743,"connectStart":390.90000009536743,"domainLookupEnd":390.90000009536743,"domainLookupStart":390.90000009536743,"fetchStart":390.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":503.80000019073486,"responseEnd":924.2000002861023,"responseStart":521.0999999046326,"secureConnectionStart":390.90000009536743},{"duration":133.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":391.2000002861023,"connectEnd":391.2000002861023,"connectStart":391.2000002861023,"domainLookupEnd":391.2000002861023,"domainLookupStart":391.2000002861023,"fetchStart":391.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":504.09999990463257,"responseEnd":524.8000001907349,"responseStart":523.9000000953674,"secureConnectionStart":391.2000002861023},{"duration":178.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":391.59999990463257,"connectEnd":391.59999990463257,"connectStart":391.59999990463257,"domainLookupEnd":391.59999990463257,"domainLookupStart":391.59999990463257,"fetchStart":391.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":513.8000001907349,"responseEnd":570.0999999046326,"responseStart":546,"secureConnectionStart":391.59999990463257},{"duration":203.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":391.90000009536743,"connectEnd":391.90000009536743,"connectStart":391.90000009536743,"domainLookupEnd":391.90000009536743,"domainLookupStart":391.90000009536743,"fetchStart":391.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":514,"responseEnd":595.0999999046326,"responseStart":570.2000002861023,"secureConnectionStart":391.90000009536743},{"duration":109.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":392.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":202.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":392.40000009536743,"connectEnd":392.40000009536743,"connectStart":392.40000009536743,"domainLookupEnd":392.40000009536743,"domainLookupStart":392.40000009536743,"fetchStart":392.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":514.5999999046326,"responseEnd":595.2000002861023,"responseStart":574.3000001907349,"secureConnectionStart":392.40000009536743},{"duration":122.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":392.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":515,"responseStart":0,"secureConnectionStart":0},{"duration":202.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":392.7000002861023,"connectEnd":392.7000002861023,"connectStart":392.7000002861023,"domainLookupEnd":392.7000002861023,"domainLookupStart":392.7000002861023,"fetchStart":392.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":514.8000001907349,"responseEnd":595.3000001907349,"responseStart":575.3000001907349,"secureConnectionStart":392.7000002861023},{"duration":510.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":405.30000019073486,"connectEnd":405.30000019073486,"connectStart":405.30000019073486,"domainLookupEnd":405.30000019073486,"domainLookupStart":405.30000019073486,"fetchStart":405.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":761.9000000953674,"responseEnd":915.7000002861023,"responseStart":906.5999999046326,"secureConnectionStart":405.30000019073486},{"duration":511.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":405.5,"connectEnd":405.5,"connectStart":405.5,"domainLookupEnd":405.5,"domainLookupStart":405.5,"fetchStart":405.5,"redirectEnd":0,"redirectStart":0,"requestStart":809.9000000953674,"responseEnd":917,"responseStart":913.3000001907349,"secureConnectionStart":405.5},{"duration":328.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":936.8000001907349,"connectEnd":936.8000001907349,"connectStart":936.8000001907349,"domainLookupEnd":936.8000001907349,"domainLookupStart":936.8000001907349,"fetchStart":936.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1234.8000001907349,"responseEnd":1265.4000000953674,"responseStart":1264.7000002861023,"secureConnectionStart":936.8000001907349}],"fetchStart":0,"domainLookupStart":79,"domainLookupEnd":86,"connectStart":86,"connectEnd":107,"secureConnectionStart":95,"requestStart":108,"responseStart":320,"responseEnd":403,"domLoading":346,"domInteractive":1511,"domContentLoadedEventStart":1511,"domContentLoadedEventEnd":1559,"domComplete":2515,"loadEventStart":2515,"loadEventEnd":2515,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1484.5},{"name":"bigPipe.sidebar-id.end","time":1485.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1485.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1486.8000001907349},{"name":"activityTabFullyLoaded","time":1589.9000000953674}],"measures":[],"correlationId":"7616983f3c87dc","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I'll change this to a New Feature since it's been the expected behavior for quite some time.