You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "makssent (via GitHub)" <gi...@apache.org> on 2025/10/30 08:44:17 UTC
[I] Proxy performance confirmation [shardingsphere]
makssent opened a new issue, #36972:
URL: https://github.com/apache/shardingsphere/issues/36972
Hi everyone! 👋
We recently started testing the performance of ShardingSphere-Proxy. We used a profiler and analyzed the results with a flamegraph, but haven’t seen any performance improvements — on the contrary, there’s some regression compared to JDBC. I don’t want to dive into testing advice for now — like “don’t use full routing,” etc. I’m more interested in something else:
👉Could you please share any articles or sources that demonstrate performance improvements with Proxy? Maybe there are materials with visual graphs or metrics showing that Proxy actually performs better (or at least on par) compared to direct database access? Or perhaps you can tell me — does Proxy currently provide any performance benefits in specific scenarios? I’ve often seen mentions that Proxy is slower than JDBC, but I haven’t found any articles that clearly show it outperforming direct database access in real benchmarks.
Thanks! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3581694951
Thank you for your response. I really appreciate that my messages were noticed — I genuinely like your approach of always staying in touch with users. I’ll capture the I/O metrics and will try to prepare the flame graphs as well. As soon as I have new data, I’ll share it right away.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3663760666
> These are the test results from my current company (SphereEx).这是我目前所在公司(SphereEx)的测试结果。 You can consider SphereEx-DBPlusEngine in the diagram as equivalent to ShardingSphere.您可以将图中的 SphereEx-DBPlusEngine 视为与 ShardingSphere 等效。 When the data volume is sufficiently large and the number of shards is adequate, both JDBC and Proxy show significant performance improvements.当数据量足够大且分片数量充足时,JDBC 和 Proxy 的性能都会有显著提升。 However, the improvement with JDBC is significantly more pronounced compared to Proxy.但是,与 Proxy 相比,使用 JDBC 带来的改进要明显得多。
>
> <img alt="Image" width="822" height="361.25" src="https://private-user-images.githubusercontent.com/5516298/507963325-e4975812-0383-4dfe-90ab-d41d3f4ce09c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU5NDY2MzYsIm5iZiI6MTc2NTk0NjMzNiwicGF0aCI6Ii81NTE2Mjk4LzUwNzk2MzMyNS1lNDk3NTgxMi0wMzgzLTRkZmUtOTBhYi1kNDFkM2Y0Y2UwOWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MTIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTEyMTdUMDQzODU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2Q4ODFiNzQ4NmUxZDI5ZWM0MmQwMWNhMGNlODlmZmQyZTQxMjQ3YWUwOTViYmIzOWVmOTU3MDU4MjFmZDgwNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.svWgmHT8rX87jEUqp69dJLNiSqP8D-6rE0nHzlLUPZI">
Hi @makssent, thank you for your detailed testing.
Here's an additional piece of information: SphereEx DBPlusEngine, an enterprise-grade product built on ShardingSphere's foundational code, offers even more enterprise-level features.
The Enterprise Edition features significant performance optimizations, providing a substantial improvement over the open-source version.
Company website: https://www.sphere-ex.com/.
Here's a comparison of the open-source and enterprise versions: https://www.sphere-ex.cn/comparison/ If you're interested, you can find their contact information on the company website.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3581577507
Updated the link to the benchmark repository. I also added a new folder with logs where I uploaded all of my test results.
https://github.com/makssent/sysbench_sphere
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3591643753
Hi @strongduanmu, I’ve done everything you asked for and ran **3 tests of 30 seconds each — before and after the changes**.
---
## 📊 Table (30 seconds, *before changes*)
| Threads | QPS #1 | QPS #2 | QPS #3 | **QPS avg** | **p95 avg (ms)** | **Queries total** | **Queries avg** |
|--------:|---------:|---------:|---------:|------------:|------------------:|-------------------:|-----------------:|
| **120** | 13401.83 | 19315.53 | 19254.07 | **17323.81** | **12.18** | **1 559 143** | **519 714.33** |
| **160** | 19177.73 | 19550.43 | 19290.10 | **19339.42** | **18.69** | **1 740 548** | **580 182.67** |
| **180** | 19379.13 | 19158.87 | 19159.23 | **19232.41** | **21.67** | **1 730 917** | **576 972.33** |
| **200** | 18433.47 | 19394.53 | 18912.33 | **18913.44** | **24.79** | **1 702 210** | **567 403.33** |
### Old flame graphs (2 runs)
1:
<img width="2000" height="1235" src="https://github.com/user-attachments/assets/0b915191-69fa-49a9-bb17-eacc304d0d14" />
2:
<img width="2000" height="1235" src="https://github.com/user-attachments/assets/8b76ffcf-5d0a-4269-8f72-e095d9a6a6d7" />
---
## 📊 Table (30 seconds, *after changes*)
| Threads | QPS #1 | QPS #2 | QPS #3 | **QPS avg** | **p95 avg (ms)** | **Queries total** | **Queries avg** |
|--------:|----------:|----------:|----------:|------------:|------------------:|-------------------:|-----------------:|
| **120** | 17828.40 | 19665.90 | 19860.93 | **19118.41** | **10.98** | **1 720 657** | **573 552.33** |
| **160** | 19912.30 | 19537.03 | 19429.63 | **19626.32** | **18.19** | **1 766 369** | **588 789.67** |
| **180** | 20246.13 | 20434.83 | 19990.00 | **20223.66** | **20.84** | **1 820 129** | **606 709.67** |
| **200** | 20119.03 | 20309.77 | 20439.80 | **20289.53** | **23.61** | **1 826 058** | **608 686.00** |
### New flame graphs (2 runs)
1:
<img width="2000" height="950" src="https://github.com/user-attachments/assets/2c395b37-04bc-4ac9-9f05-ed02bd6a414b" />
2:
<img width="2000" height="1064" src="https://github.com/user-attachments/assets/052f0e07-dba4-448f-bfce-513e3f8a5ff0" />
---
## 📈 Comparison (before → after)
| Threads | QPS avg (before) | QPS avg (after) | Δ QPS | Δ % |
|--------:|------------------:|----------------:|------:|-----:|
| **120** | 17323.81 | 19118.41 | **+1794.60** | **+10.36%** |
| **160** | 19339.42 | 19626.32 | **+286.90** | **+1.48%** |
| **180** | 19232.41 | 20223.66 | **+991.25** | **+5.15%** |
| **200** | 18913.44 | 20289.53 | **+1376.09** | **+7.28%** |
---
As you can see, there is an improvement, but it’s not very large. I understand that many things can still be optimized, but I don’t believe it’s realistic to push the Proxy to 4.5×. Right now, in an ideal (but rare) run we get around 2.5×, in good runs about 2×, and on average something like 1.5–2×. I honestly don’t see how this could be pushed to 4.5× as in your example.
If needed, I can also provide full I/O metrics, an archive with all logs, or compile everything into a single detailed report.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3470995545
Here is also a research paper ([link](https://ieeexplore.ieee.org/document/9835604)) that includes the results of performance testing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3467405811
ShardingSphere-Proxy does indeed perform worse than ShardingSphere-JDBC, and ShardingSphere-JDBC will also be slower than a direct database connected (since it adds some new features). Based on past experience, ShardingSphere-Proxy can be over 30% slower than ShardingSphere-JDBC.
We can explore ways to improve performance. If necessary, you may provide flame graphs to analyze where the performance bottlenecks are together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3569324697
I ran your test, but I was not able to reproduce the throughput gain shown in your example (×4.5) for OLTP Point Select. In my environment the cluster is indeed faster than the single node, but the speedup is at most around ~2x. I’m probably missing some important factor or misinterpreting the results — I’d really appreciate any hints on what else to look at or adjust.
Environment
- NODE 1–5: 4 CPU, 8 GB RAM, SSD 65
- Client: 4 CPU, 8 GB RAM, SSD 65
- Proxy: 12 CPU, 8 GB RAM, SSD 65
- Single node: 4 CPU, 8 GB RAM, SSD 65
Data volume
- Single: 40M rows
- Cluster: 8M rows per node (5 nodes, total 40M rows, just distributed)
2 GB is allocated for the InnoDB buffer pool. I checked that the buffer is empty → filled the table up to 8M rows → ran a warmup:
```sql
SELECT id FROM t_order_0 FORCE INDEX (PRIMARY) ORDER BY id LIMIT 1000000000;
...
SELECT id FROM t_order_9 FORCE INDEX (PRIMARY) ORDER BY id LIMIT 1000000000;
```
After that I ran a couple of test OLTP Point SELECT runs to stabilize the buffer — the buffer filled up and did not grow anymore, the page count did not change, everything was working from memory.
In theory, the speedup should come from the fact that the cluster works entirely from the buffer, while the single node constantly goes to disk, which is slower. In practice, the cluster indeed does not perform any disk reads, and the single node performs millions of disk reads, but the improvement turned out to be much smaller than expected.
**The proxy also does not look like a bottleneck — its CPU utilization does not exceed 95%.**
Single and Cluster were tested with the same Java benchmark (OLTP Point SELECT), only in one case the requests go directly to Single, and in the second — through Proxy to the cluster. So the “Java factor” and the client side are identical. Below are the results of all runs.
### CLUSTER — runs
5 runs × 30 seconds (Cluster)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** | disk_reads | pages_used |
|--------:|-------:|-------:|-------:|-------:|-------:|-------------:|-------------:|----------------------|----------------------|
| 120 | 12557 | 8967 | 11823 | 10555 | 8659 | **10512** | **10.77 ms** | 122171 → 122171 | 122603 → 122603 |
| 160 | 12677 | 12116 | 14930 | 14930 | 11067 | **13144** | **12.18 ms** | 122171 → 122171 | 122603 → 122603 |
| 180 | 12318 | 13254 | 11200 | 17240 | 12288 | **13260** | **13.82 ms** | 122171 → 122171 | 122603 → 122603 |
| 200 | 14058 | 14721 | 13771 | 14044 | 11372 | **13593** | **14.78 ms** | 122171 → 122171 | 122603 → 122603 |
*(further `pages_used` and `disk_reads` stay unchanged: `pages_used` shows InnoDB buffer pool usage and remains non-full, and `disk_reads` stays at zero — the cluster continues to serve all reads from buffer)*
5 runs × 60 seconds (Cluster)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** |
|--------:|-------:|-------:|-------:|-------:|-------:|-------------:|-------------:|
| 120 | 16743 | 19928 | 21718 | 22012 | 20496 | **20179** | **5.99 ms** |
| 160 | 18968 | 22258 | 22408 | 20870 | 22067 | **21314** | **7.30 ms** |
| 180 | 18945 | 20349 | 20888 | 21413 | 22268 | **20773** | **8.38 ms** |
| 200 | 19581 | 20689 | 22349 | 22426 | 22810 | **21571** | **8.88 ms** |
5 runs × 120 seconds (Cluster)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** |
|--------:|-------:|-------:|-------:|-------:|-------:|-------------:|-------------:|
| 120 | 18910 | 14995 | 15874 | 12802 | 13599 | **15236** | **8.47 ms** |
| 160 | 17773 | 17849 | 16568 | 14175 | 14924 | **16258** | **11.71 ms** |
| 180 | 16472 | 18713 | 16073 | 12534 | 15560 | **15870** | **13.53 ms** |
| 200 | 16226 | 16706 | 14546 | 13671 | 16393 | **15508** | **14.72 ms** |
---
### SINGLE — runs
5 runs × 30 seconds (Single)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** | disk_reads (total) | disk_reads_avg | pages_used |
|--------:|--------:|--------:|--------:|--------:|--------:|--------------:|---------------:|--------------------:|----------------:|-------------|
| 120 | 9416 | 9721 | 9525 | 9525 | 9441 | **9526** | **11.87 ms** | 1 144 157 | 228 831 | 131056 / 131072 |
| 160 | 9809 | 10412 | 9805 | 9788 | 9842 | **9951** | **16.09 ms** | 1 192 311 | 238 462 | 131056 / 131072 |
| 180 | 9755 | 10212 | 9748 | 9400 | 9510 | **9725** | **18.56 ms** | 1 167 719 | 233 544 | 131056 / 131072 |
| 200 | 10239 | 9942 | 10044 | 9719 | 9780 | **9925** | **20.24 ms** | 1 194 994 | 238 999 | 131056 / 131072 |
*(from here on, `pages_used` is always 131056/131072 — the buffer is fully filled; further focus is on `disk_reads`)*
5 runs × 60 seconds (Single)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** | disk_reads (total) | disk_reads_avg |
|--------:|--------:|--------:|--------:|--------:|--------:|--------------:|---------------:|--------------------:|----------------:|
| 120 | 9651 | 9828 | 9775 | 9896 | 9835 | **9797** | **11.91 ms** | 2 352 894 | 470 579 |
| 160 | 9794 | 9799 | 9783 | 9888 | 9647 | **9782** | **16.33 ms** | 2 348 209 | 469 642 |
| 180 | 9900 | 9707 | 9921 | 9740 | 9903 | **9834** | **18.38 ms** | 2 360 695 | 472 139 |
| 200 | 9746 | 9971 | 9914 | 9717 | 9794 | **9828** | **20.53 ms** | 2 360 267 | 472 053 |
5 runs × 120 seconds (Single)
| Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **avg** | disk_reads (total) | disk_reads_avg |
|--------:|--------:|--------:|--------:|--------:|--------:|--------------:|---------------:|--------------------:|----------------:|
| 120 | 9888 | 8282 | 8833 | 10478 | 10135 | **9523** | **13.35 ms** | 4 072 067 | 814 413 |
| 160 | 9961 | 8372 | 8552 | 11245 | 9814 | **9589** | **17.47 ms** | 4 180 584 | 836 116 |
| 180 | 9901 | 8443 | 8931 | 12069 | 9435 | **9756** | **19.58 ms** | 4 319 040 | 863 808 |
| 200 | 9851 | 8215 | 8357 | 12035 | 5988 | **8889** | **24.88 ms** | 3 971 902 | 794 380 |
---
### CLUSTER vs SINGLE — comparison
5 runs × 30 seconds
| Threads | **QPS Cluster** | **QPS Single** | avg Cluster | avg Single | disk_reads Cluster | disk_reads Single | QPS gain (%) |
|--------:|-----------------:|---------------:|-------------:|-------------:|---------------------:|--------------------:|--------------:|
| 120 | 10512 | 9526 | 10.77 ms | 11.87 ms | 0 | 1 144 157 | +10.3% |
| 160 | 13144 | 9951 | 12.18 ms | 16.09 ms | 0 | 1 192 311 | +32.1% |
| 180 | 13260 | 9725 | 13.82 ms | 18.56 ms | 0 | 1 167 719 | +36.3% |
| 200 | 13593 | 9925 | 14.78 ms | 20.24 ms | 0 | 1 194 994 | +36.9% |
5 runs × 60 seconds
| Threads | **QPS Cluster** | **QPS Single** | avg Cluster | avg Single | disk_reads Cluster | disk_reads Single | QPS gain (%) |
|--------:|-----------------:|---------------:|-------------:|-------------:|---------------------:|--------------------:|--------------:|
| 120 | 20179 | 9797 | 5.99 ms | 11.91 ms | 0 | 2 352 894 | +106.0% |
| 160 | 21314 | 9782 | 7.30 ms | 16.33 ms | 0 | 2 348 209 | +117.9% |
| 180 | 20773 | 9834 | 8.38 ms | 18.38 ms | 0 | 2 360 695 | +111.3% |
| 200 | 21571 | 9828 | 8.88 ms | 20.53 ms | 0 | 2 360 267 | +119.5% |
5 runs × 120 seconds
| Threads | **QPS Cluster** | **QPS Single** | avg Cluster | avg Single | disk_reads Cluster | disk_reads Single | QPS gain (%) |
|--------:|-----------------:|---------------:|-------------:|-------------:|---------------------:|--------------------:|--------------:|
| 120 | 15236 | 9523 | 8.47 ms | 13.35 ms | 0 | 4 072 067 | +59.9% |
| 160 | 16258 | 9589 | 11.71 ms | 17.47 ms | 0 | 4 180 584 | +69.6% |
| 180 | 15870 | 9756 | 13.53 ms | 19.58 ms | 0 | 4 319 040 | +62.7% |
| 200 | 15508 | 8889 | 14.72 ms | 24.88 ms | 0 | 3 971 902 | +74.5% |
---
In summary: there is indeed a performance gain, but at most about 100–120%, which is noticeably lower than in your example (×4.5). At the same time, the Single node shows significantly more stable results — the QPS range almost does not change, while in the cluster the metrics can vary from run to run.
I did not use Sysbench — I plan to run similar tests later on another DBMS for which there are no ready-made Sysbench scripts. To have a universal scenario from the start, I use a Java benchmark (OLTP Point Select), and it is the same for both Single and Cluster.
If I am misinterpreting the results, or there are MySQL/Proxy settings that should be adjusted, I would really appreciate any recommendations. Maybe I missed an important detail in the config or in the load scenario.
My Proxy config:
```yaml
# database-sharding.yaml
databaseName: sharding_db
dataSources:
ds0:
url: jdbc:mysql://localhost:3306/ds_0?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true
username: root
password: pass
connectionTimeoutMilliseconds: 200000
idleTimeoutMilliseconds: 120000
maxLifetimeMilliseconds: 1800000
ds1:
url: jdbc:mysql://localhost:3306/ds_1?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true
username: root
password: pass
connectionTimeoutMilliseconds: 200000
idleTimeoutMilliseconds: 120000
maxLifetimeMilliseconds: 1800000
ds2:
url: jdbc:mysql://localhost:3306/ds_2?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true
username: root
password: pass
connectionTimeoutMilliseconds: 200000
idleTimeoutMilliseconds: 120000
maxLifetimeMilliseconds: 1800000
ds3:
url: jdbc:mysql://localhost:3306/ds_3?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true
username: root
password: pass
connectionTimeoutMilliseconds: 200000
idleTimeoutMilliseconds: 120000
maxLifetimeMilliseconds: 1800000
ds4:
url: jdbc:mysql://localhost:3306/ds_4?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true
username: root
password: pass
connectionTimeoutMilliseconds: 200000
idleTimeoutMilliseconds: 120000
maxLifetimeMilliseconds: 1800000
rules:
- !SHARDING
tables:
t_order:
actualDataNodes: ds${0..4}.t_order_${0..9}
databaseStrategy:
standard:
shardingColumn: id
shardingAlgorithmName: db_by_id_inline
tableStrategy:
standard:
shardingColumn: id
shardingAlgorithmName: tbl_by_id_inline
shardingAlgorithms:
db_by_id_inline:
type: INLINE
props:
algorithm-expression: ds${(int)(id / 8000000)}
tbl_by_id_inline:
type: INLINE
props:
algorithm-expression: t_order_${(int)((id % 8000000) / 800000)}
keyGenerators:
snowflake:
type: SNOWFLAKE
```
```yaml
#global.yaml
mode:
type: Standalone
repository:
type: JDBC
authority:
users:
- user: root@%
password: root
admin: true
- user: sharding@%
password: sharding
authenticators:
native:
type: NATIVE
privilege:
type: ALL_PERMITTED
transaction:
defaultType: LOCAL
sqlParser:
sqlStatementCache:
initialCapacity: 2000
maximumSize: 65535
parseTreeCache:
initialCapacity: 128
maximumSize: 1024
sqlFederation:
sqlFederationEnabled: false
executionPlanCache:
initialCapacity: 2000
maximumSize: 65535
props:
system-log-level: INFO
sql-show: false
check-table-metadata-enabled: false
proxy-frontend-executor-size: 0
proxy-frontend-max-connections: 0
proxy-frontend-ssl-enabled: false
proxy-netty-backlog: 1024
cdc-server-port: 33071
proxy-default-port: 3313
```
Proxy connection config:
```properties
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3313/sharding_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true&useCursorFetch=false
spring.datasource.username=sharding
spring.datasource.password=sharding
spring.datasource.hikari.maximum-pool-size=200
spring.datasource.hikari.minimum-idle=0
spring.datasource.hikari.connection-timeout=65000
spring.datasource.hikari.idle-timeout=120000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.keepalive-time=30000
spring.datasource.hikari.leak-detection-threshold=0
```
Single-node connection config:
```properties
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/single_db?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=256&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true&useCursorFetch=false
spring.datasource.username=root
spring.datasource.password=pass
spring.datasource.hikari.maximum-pool-size=200
spring.datasource.hikari.minimum-idle=0
spring.datasource.hikari.connection-timeout=65000
spring.datasource.hikari.idle-timeout=120000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.keepalive-time=30000
spring.datasource.hikari.leak-detection-threshold=0
```
**Project to reproduce the tests
Full repository with the benchmark, configs and load code:
👉 https://github.com/makssent/sysbench_reposit**
I would appreciate it if you could help clarify why the speedup is lower than expected and what else I can check or adjust.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3471607598
> Вот результаты тестирования в моей нынешней компании (SphereEx). SphereEx-DBPlusEngine на схеме можно считать эквивалентом ShardingSphere. При достаточно большом объёме данных и адекватном количестве шардов как JDBC, так и Proxy демонстрируют значительное повышение производительности. Однако прирост производительности JDBC значительно более выражен, чем при использовании Proxy.
Thanks for sharing your benchmarks and examples. Did you use the standard MySQL Proxy from ShardingSphere without any custom modifications?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3588546770
Hi @makssent, you can use custome sharding algorithm to replace inline sharding algorithm. Because groovy expressions have some overhead.
<img width="1782" height="828" alt="Image" src="https://github.com/user-attachments/assets/0aedaed8-5b59-4550-8113-5aaf46cbd5ee" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3664156488
I think I’ve managed to figure out the issue.
It turned out to be related to the VM configuration, specifically the **virtio drivers**. In our setup, they were effectively overloading a single CPU core and preventing the proxy from fully utilizing available resources, which limited performance.
After moving **ShardingSphere Proxy** into a **Docker container**, the problem disappeared and scaling started to work as expected. At peak, we observed a performance improvement of about **x4.1–x4.2**. Further limitations were no longer environment-related but came from the proxy itself becoming a bottleneck:
- on **4 nodes**, the QPS gain was noticeably smaller than between 2 and 3 nodes;
- on **5 nodes**, there was almost no improvement — the proxy stopped scaling.
That said, scalability was clearly confirmed up to **3–4 nodes**.
---
### Test results
| **Configuration** | **QPS #1** | **QPS #2** | **QPS #3** | **Avg QPS** | **Avg p95 (ms)** | **Gain vs single (40M)** |
|-----------------------------------------------|------------|------------|------------|-------------|------------------|--------------------------|
| **Single JDBC (no Proxy, 40M records)** | 1919.38 | 1819.93 | 2023.55 | **1920.95** | **129.62** | — |
| ShardingSphere Proxy (RDB, 2 nodes, 8M each) | 5162.60 | 5000.10 | 5265.58 | **5142.76** | 29.99 | +167.8% (×2.68) |
| ShardingSphere Proxy (RDB, 3 nodes, 8M each) | 7080.13 | 7237.47 | 7239.47 | **7185.69** | 33.06 | +274.1% (×3.74) |
| ShardingSphere Proxy (RDB, 4 nodes, 8M each) | 8707.05 | 8430.93 | 8808.70 | **8648.89** | 33.25 | +350.3% (×4.50) |
| **ShardingSphere Proxy (RDB, 5 nodes, 8M each)** | 8862.07 | 7492.58 | 7617.75 | **7990.80** | 63.96 | +316.1% (×4.16) |
---
### About result reliability
Some of these numbers may look **too optimistic** (for example, around **x2.5 on 2 nodes**). This is mainly due to **unstable VM performance** rather than ShardingSphere itself.
We observed cases where:
- the single-node setup produced about **2500 QPS**,
- and an hour later, under otherwise identical conditions, only **~1800 QPS**.
In addition, the comparison was not fully symmetric:
- the cluster was tested with **16–24M records**,
- while the single setup used **40M records**.
To obtain truly accurate numbers, such tests should be performed on **bare-metal hardware**. However, our goal at this stage was simply to confirm **whether scalability exists at all**, and that was successfully demonstrated. We also observed real connection parallelism (around **200 connections per node**), which was sufficient for us to move forward.
---
<details>
<summary><b>About Firebird ReadOnly mode</b></summary>
Initially, I was unable to get good performance on **Firebird** due to the **ReadOnly mode**.
ReadOnly was enabled on the **single-node setup**, but **Firebird does not support ReadOnly mode in a clustered configuration**. Because of this, the comparison was incorrect and the performance gain looked very small.
After disabling ReadOnly for the single-node setup as well, performance appeared and scalability became clearly visible.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3581536549
In total, I’ve run a huge number of tests: changed nodes, tested different combinations (2/3/4 nodes, etc.), and it’s now completely clear that the issue is not in the nodes. They work consistently and don’t lose performance as the dataset grows. For example, 2 nodes = 8+8M rows produce roughly the same results as 3 nodes = 8+8+8M. So the nodes themselves operate correctly and stably.
Logically, this would imply that the single-node setup should slow down significantly, but based on my calculations — that’s not happening. When increasing the dataset from 16M to 24M rows, the single node doesn’t degrade enough to justify a +300% performance gain from 3 nodes compared to +200% from 2 nodes. Because of this, it’s unclear where such a large scaling boost is supposed to come from.
I’ll also prepare a separate comparison showing how the single node slows down at 8, 16, 24, 32, and 40 million rows to measure the drop per +8M (equivalent to adding one node in the cluster). But based on what I’ve seen, there likely won’t be a strong regression there — unless the database were running on HDDs, which is obviously not our case.
If you have any ideas or insights on this, I’d appreciate them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3470987689
These are the test results from my current company (SphereEx).
You can consider SphereEx-DBPlusEngine in the diagram as equivalent to ShardingSphere.
When the data volume is sufficiently large and the number of shards is adequate, both JDBC and Proxy show significant performance improvements.
However, the improvement with JDBC is significantly more pronounced compared to Proxy.
<img width="1074" height="472" alt="Image" src="https://github.com/user-attachments/assets/e4975812-0383-4dfe-90ab-d41d3f4ce09c" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3597738941
Next, I plan to test the network layer to verify whether it might be acting as a bottleneck.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3596300010
Let me refresh the data a bit, because during this time I tested many different configurations and made various adjustments.
## Cluster Benchmark (200 threads)
| Duration | QPS #1 | QPS #2 | QPS #3 | **QPS Avg** | p95 #1 | p95 #2 | p95 #3 | **p95 Avg (ms)** |
|----------|--------|--------|--------|-------------|--------|--------|--------|-------------------|
| **30s** | 12101.23 | 13172.53 | 12348.53 | **12540.76** | 26.753 | 25.773 | 27.758 | **26.76** |
| **60s** | 14958.77 | 16880.63 | 16072.38 | **15970.59** | 24.482 | 20.582 | 21.288 | **22.12** |
| **120s** | 20357.69 | 14640.98 | 17766.53 | **17588.40** | 18.248 | 20.635 | 20.587 | **19.82** |
## SingleDB Benchmark (200 threads)
| Duration | QPS #1 | QPS #2 | QPS #3 | **QPS Avg** | p95 #1 | p95 #2 | p95 #3 | **p95 Avg (ms)** |
|----------|----------|----------|----------|-------------|---------|---------|---------|-------------------|
| **30s** | 9282.47 | 9295.67 | 9088.30 | **9222.15** | 72.246 | 66.671 | 69.021 | **69.31** |
| **60s** | 9375.52 | 9648.97 | 9532.12 | **9518.87** | 88.779 | 87.511 | 90.904 | **89.07** |
| **120s** | 8935.35 | 9191.13 | 9431.38 | **9185.95** | 110.902 | 111.966 | 109.380 | **110.75** |
## Comparative Benchmark Results (Cluster vs Single, 200 threads)
| Duration | QPS Single | QPS Cluster | QPS Gain (%) | p95 Single (ms) | p95 Cluster (ms) |
|----------|-----------:|------------:|----------------------:|----------------:|-----------------:|
| **30s** | 9222.15 | 12540.76 | **+35.9% (×1.36)** | 69.31 | 26.76 |
| **60s** | 9518.87 | 15970.59 | **+67.7% (×1.68)** | 89.07 | 22.12 |
| **120s** | 9185.95 | 17588.40 | **+91.5% (×1.92)** | 110.75 | 19.82 |
---
### CPU Load on Single (120s)
<img width="534" height="792" alt="Single CPU Load" src="https://github.com/user-attachments/assets/4a90c04c-e040-4404-9893-e16df5b46f01" />
As visible in the chart, during the 120-second runs the Single node reaches **93–100% total CPU load**.
### CPU Load on a Cluster Node (120s)
<img width="394" height="592" alt="Cluster Node CPU Load" src="https://github.com/user-attachments/assets/aac29d2d-08e7-4018-b465-c32e94e97a17" />
The cluster node CPU barely feels the load.
I included CPU graphs because one colleague suggested that Proxmox might distribute virtual CPU cores incorrectly, causing cluster VM nodes to compete for the same physical cores. However, the graphs show no evidence of CPU contention.
If virtualization were limiting RAM, cluster nodes would experience buffer pool pressure and fall back to disk I/O — but this does not happen.
In contrast, the Single node frequently performs physical reads.
Therefore, the issue does not appear to be related to virtualization.
---
### SphereEX Reference Hardware
| Component | Value |
|----------|--------|
| CPU | 48 cores |
| Memory | 96 GB |
| Disk | SSD 820 GB |
The documentation does not specify whether this refers to a single physical machine or a set of VMs.
Comparing your p95 results with mine:
in our 60-second run, the cluster p95 is about **22 ms**, while the Single node shows about **89 ms**.
The latency reduction is significant, yet QPS increases only to **×1.36–×1.92**, far from the **×4.5** in your benchmark.
If there is anything else I can provide to help clarify the situation, I am ready to collect additional metrics. I do not believe Proxy optimizations alone could realistically increase performance from this range up to ×4.5 in the current environment.
---
### Current Situation Summary
- The Single node pushes CPU usage close to 100%.
- RAM is distributed correctly across cluster nodes, with no signs of virtualization-related memory pressure.
- Network throughput has not been tested yet; I can check it if needed.
- The workload is equivalent to Sysbench OLTP Point Select, and correctness was verified directly through MySQL.
- Dataset sizes match your example: 40M rows on Single, 8M rows per cluster node; each MySQL instance has a 2 GB buffer pool.
The Single node performs about 80% physical reads, which causes regression but still does not approach ×4.5.
If you need any additional information, I will be happy to provide it.
Your questions may help point me toward the root cause.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3467609347
> ShardingSphere-Proxy does indeed perform worse than ShardingSphere-JDBC, and ShardingSphere-JDBC will also be slower than a direct database connected (since it adds some new features). Based on past experience, ShardingSphere-Proxy can be over 30% slower than ShardingSphere-JDBC. We can explore ways to improve performance. If necessary, you may provide flame graphs to analyze where the performance bottlenecks are together.
I understand and accept that.
It’s logical that with a single shard, there’s an additional routing layer introduced by ShardingSphere, and in that case, Proxy will naturally perform slower than a direct database connection.
However, as I understand it, this overhead should be compensated when the number of shards increases — for example, with 2, 4, 6, or 8 shards, where the load is distributed and the overall effect should balance out the routing costs.
But according to our tests, we don’t see that happening: performance does increase, but not proportionally to the loss introduced by Proxy.
With JDBC, on the other hand, everything works as expected — performance scales up and the improvement is noticeable.
That’s why I wanted to ask — are there any articles, posts, or public results where someone has tested ShardingSphere-Proxy and achieved performance gains?
Perhaps you or the community have conducted such experiments — I just haven’t come across any examples showing Proxy providing an actual performance improvement, only comparisons indicating that Proxy is slower than JDBC.
Right now, we’re deciding whether to continue investing in improving Proxy or to focus on adapting the JDBC variant for our needs.
Of course, we understand that performance depends on many factors — database size, number of shards, hardware configuration, and so on — but it would really help to see a real-world example where Proxy shows a performance improvement as the number of shards increases, compared to a regular database connection without ShardingSphere. That way, we could reproduce such an experiment, verify the results, and make further decisions based on that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3664136048
> Hi [@makssent](https://github.com/makssent), thank you for your detailed testing.
Hi @strongduanmu,
Regarding **SphereEX** — at the moment, we probably don’t need it. I’m not working with MySQL but with **Firebird**, which is currently not supported by SphereEX. MySQL was used only for testing purposes, as it has long been integrated into ShardingSphere and was not expected to have issues.
Our main goal was to understand whether **Firebird** scales at all, and only after that move on to optimization and other processes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3595274167
Hi @terrymanu @strongduanmu,
Someone pointed out an important detail to me.
Did you use dedicated physical machines for the MySQL nodes in your benchmarks, or were they virtualized instances?
I’m currently using VMs on Proxmox, and it’s possible that resource allocation there isn’t fully optimal, which might explain the lack of performance improvement on my side. I will verify this, but I would also like to know what environment you used — were they virtual machines (and if so, which type), or physical servers?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3600546834
I checked the network between the Proxy and all cluster nodes. I ran the following tests on each node:
```
iperf3 -c NODEX -t 10
iperf3 -c NODEX -P 4 -t 10
iperf3 -c NODEX -R -t 10
```
Results without Proxy running:
| Node | Single | Multi (P=4) | Reverse |
|-------|----------------|----------------|----------------|
| NODE1 | ~23.5 Gbit/s | ~29.2 Gbit/s | ~22.9 Gbit/s |
| NODE2 | ~21.8 Gbit/s | ~28.4 Gbit/s | ~24.5 Gbit/s |
| NODE3 | ~23.5 Gbit/s | ~21.8 Gbit/s | ~23.6 Gbit/s |
| NODE4 | ~25.0 Gbit/s | ~29.7 Gbit/s | ~23.3 Gbit/s |
| NODE5 | ~23–27 Gbit/s | ~29–30 Gbit/s | ~26.4 Gbit/s |
The network works stably in the 22–30 Gbit/s range, without drops or instability. With Proxy running (but without OLTP load), throughput remains at the same level — around 22–24 Gbit/s.
When OLTP tests (200 threads) are running, iperf3 and Proxy begin to compete for CPU and the network stack. Because of this, iperf3 speed initially stays around ~20–23 Gbit/s, but then drops:
```
743 MBytes 6.12 Gbits/sec
680 MBytes 5.79 Gbits/sec
602 MBytes 4.99 Gbits/sec
580 MBytes 4.99 Gbits/sec
...
208 MBytes 1.65 Gbits/sec
165 MBytes 1.27 Gbits/sec
137 MBytes 1.15 Gbits/sec
125 MBytes 1.12 Gbits/sec
```
As soon as the load decreases, the speed returns to the normal level:
```
[ 5] 57.00-58.00 sec 2.53 GBytes 21.7 Gbits/sec
[ 5] 58.00-59.00 sec 2.75 GBytes 23.7 Gbits/sec
[ 5] 59.00-60.00 sec 2.67 GBytes 22.9 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-60.00 sec 86.5 GBytes 12.4 Gbits/sec sender
[ 5] 0.00-60.00 sec 86.5 GBytes 12.4 Gbits/sec receiver
```
Even the minimal speed (1–2 Gbit/s) is still higher than the actual SQL traffic of the Proxy. The network between Proxy and nodes is not a bottleneck. There is more than enough throughput for all OLTP tests, and no network limitations are observed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent closed issue #36972: Proxy performance confirmation
URL: https://github.com/apache/shardingsphere/issues/36972
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3477261826
Yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3467627524
I understand that I could provide you with a flamegraph or other performance metrics, but I think it’s not very useful at this stage — we could keep optimizing endlessly without a clear goal.
What I’d really like to see right now is whether there’s any existing example where Proxy showed a performance improvement on PostgreSQL or MySQL.
If such a case exists, it would confirm that achieving better performance is possible, and we could try to reproduce that experiment or at least use it as a reference point to guide further optimization.
At this point, I’m mostly trying to understand whether Proxy, in general, can provide performance benefits, independent of the specific database being used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3585667745
I’ve collected some of the metrics. The table for the Single nodes isn’t ready yet — I’ll send it later. For now, I’m sharing the I/O metrics and the Flame Graphs.

I didn’t attach everything directly here because GitHub didn’t allow uploading the files.
I added the full (though small) set of metrics to a release instead:https://github.com/makssent/sysbench_sphere/releases/tag/metrics
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3602233863
I think there is no need to look into anything further in this ticket for now. I’m currently rebuilding the virtual machines, and I’ll rerun the tests on the new setup. Once I have updated results, I’ll come back with fresh data. Hopefully, we’ll be able to close this ticket successfully. I’ll be back soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3574994682
I found a critical issue in my previous benchmark data.
The problem has been identified and fixed on my side.
I will rerun the tests with the corrected logic and return with updated results.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "makssent (via GitHub)" <gi...@apache.org>.
makssent commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3576028429
There were some debatable moments during testing. I aligned everything with SYSBENCH, but there are no changes in performance — only stabilized results, and now the metrics are identical to SYSBENCH.
---
## SINGLE — 30-second runs (5 runs × 30s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 4264.20 | 5233.57 | 4807.77 | 5169.20 | 4380.47 | **4771.04** | **101.10 ms** | **716 656** | **143 331** | **553 357** | **110 671**
160 | 4431.60 | 5544.27 | 5930.30 | 4358.17 | 4723.37 | **4997.54** | **113.13 ms** | **749 631** | **149 926** | **599 471** | **119 894**
180 | 4433.53 | 5304.10 | 5850.93 | 4618.50 | 4277.77 | **4896.97** | **153.27 ms** | **734 545** | **146 909** | **587 842** | **117 568**
200 | 3818.73 | 5089.50 | 6021.27 | 4561.00 | 4324.87 | **4763.07** | **169.74 ms** | **714 461** | **142 892** | **570 722** | **114 144**
---
## SINGLE — 60-second runs (5 runs × 60s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 4913.78 | 5295.62 | 5192.07 | 5477.22 | 4185.83 | **5012.90** | **105.33 ms** | **1 503 871** | **300 774** | **1 203 148** | **240 630**
160 | 5194.27 | 5655.33 | 5015.72 | 5449.72 | 3989.92 | **5060.99** | **132.07 ms** | **1 518 297** | **303 659** | **1 213 650** | **242 730**
180 | 5421.23 | 5408.20 | 4959.35 | 5517.52 | 5052.55 | **5271.77** | **158.64 ms** | **1 581 531** | **316 306** | **1 265 990** | **253 198**
200 | 5391.20 | 5470.05 | 5539.00 | 4800.17 | 5003.93 | **5240.87** | **168.57 ms** | **1 572 261** | **314 452** | **1 257 970** | **251 594**
---
## SINGLE — 120-second runs (5 runs × 120s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 4980.14 | 2970.04 | 4114.28 | 4007.80 | 2702.25 | **3754.10** | **130.99 ms** | 2 252 942 | 450 588 | 1 703 743 | 340 749
160 | 5363.02 | 2967.93 | 4284.31 | 4796.78 | 3756.18 | **4233.64** | **176.19 ms** | 2 440 185 | 488 037 | 1 833 697 | 366 739
180 | 4577.58 | 4064.78 | 3947.65 | 3787.37 | 3422.74 | **3960.82** | **176.97 ms** | 2 375 014 | 475 003 | 1 891 278 | 378 255
200 | 3232.85 | 4322.37 | 4189.58 | 2194.95 | 3346.31 | **3457.21** | **262.67 ms** | 1 984 283 | 396 857 | 1 508 043 | 301 609
---
## CLUSTER — 30-second runs (5 runs × 30s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 7092.43 | 7224.40 | 8369.73 | 5454.40 | 6440.63 | **6916.32** | **30.13 ms** | **1 037 448** | **207 490** | **0** | **0**
160 | 8500.50 | 8369.83 | 9625.53 | 6934.03 | 6745.33 | **8035.04** | **36.75 ms** | **1 205 257** | **241 051** | **3** | **1**
180 | 9088.23 | 9441.10 | 8447.07 | 8289.43 | 7180.90 | **8489.35** | **40.33 ms** | **1 273 402** | **254 680** | **1** | **0**
200 | 9145.90 | 9067.00 | 8657.03 | 7505.47 | 8448.00 | **8564.68** | **45.46 ms** | **1 284 702** | **256 940** | **6** | **1**
---
## CLUSTER — 60-second runs (5 runs × 60s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 6038.62 | 7267.73 | 7172.95 | 8583.25 | 6620.23 | **7136.16** | **32.73 ms** | **2 205 867** | **441 173** | **1** | **0**
160 | 6727.03 | 9195.58 | 7880.45 | 7766.42 | 6679.37 | **7649.37** | **37.13 ms** | **2 900 701** | **580 140** | **0** | **0**
180 | 7305.70 | 10950.95 | 8430.73 | 5855.27 | 7275.10 | **7963.15** | **46.17 ms** | **2 857 302** | **571 460** | **0** | **0**
200 | 7070.50 | 9946.05 | 7558.12 | 6070.97 | 6430.62 | **7415.25** | **57.16 ms** | **2 588 363** | **517 672** | **1** | **0**
---
## CLUSTER — 120-second runs (5 runs × 120s)
Threads | QPS #1 | QPS #2 | QPS #3 | QPS #4 | QPS #5 | **QPS avg** | **p95 avg** | **Queries total** | **Queries avg** | **disk_reads total** | **disk_reads avg**
--------|--------|--------|--------|--------|--------|-------------|--------------|--------------------|------------------|-----------------------|--------------------
120 | 2892.16 | 3631.78 | 6038.62 | 7267.73 | 7172.95 | **5390.65** | **43.94 ms** | **2 127 485** | **425 497** | **1** | **0**
160 | 4513.17 | 3910.93 | 6727.03 | 9195.58 | 7880.45 | **6445.03** | **41.70 ms** | **2 533 239** | **506 648** | **0** | **0**
180 | 3926.22 | 5106.11 | 7305.70 | 10950.95 | 8430.73 | **7151.54** | **65.75 ms** | **3 041 546** | **608 309** | **0** | **0**
200 | 4912.89 | 4621.41 | 7070.50 | 9946.05 | 7558.12 | **6821.39** | **70.57 ms** | **3 057 625** | **611 525** | **1** | **0**
---
## comparison — 30s / 60s / 120s
### 30 seconds
Threads | **QPS Cluster** | **QPS Single** | **p95 Cluster** | **p95 Single** | **disk_reads Cluster** | **disk_reads Single** | **QPS gain**
--------|------------------|----------------|------------------|----------------|-------------------------|------------------------|--------------
120 | **6916.32** | 4771.04 | 30.13 ms | 101.10 ms | 0 | 553357 | **+45.0%**
160 | **8035.04** | 4997.54 | 36.75 ms | 113.13 ms | 1 | 599471 | **+60.7%**
180 | **8489.35** | 4896.97 | 40.33 ms | 153.27 ms | 0 | 587842 | **+73.4%**
200 | **8564.68** | 4763.07 | 45.46 ms | 169.74 ms | 1 | 570722 | **+79.8%**
### 60 seconds
Threads | **QPS Cluster** | **QPS Single** | **p95 Cluster** | **p95 Single** | **disk_reads Cluster** | **disk_reads Single** | **QPS gain**
--------|------------------|----------------|------------------|----------------|-------------------------|------------------------|--------------
120 | **7136.16** | 5012.90 | 32.73 ms | 105.33 ms | 0 | 1 203 148 | **+42.3%**
160 | **7649.37** | 5060.99 | 37.13 ms | 132.07 ms | 0 | 1 213 650 | **+51.1%**
180 | **7963.15** | 5271.77 | 46.17 ms | 158.64 ms | 0 | 1 265 990 | **+51.0%**
200 | **7415.25** | 5240.87 | 57.16 ms | 168.57 ms | 0 | 1 257 970 | **+41.5%**
### 120 seconds
Threads | **QPS Cluster** | **QPS Single** | **p95 Cluster** | **p95 Single** | **disk_reads Cluster** | **disk_reads Single** | **QPS gain**
--------|------------------|----------------|------------------|----------------|-------------------------|------------------------|--------------
120 | **5390.65** | 3754.10 | 43.94 ms | 130.99 ms | 0 | 1 703 743 | **+43.6%**
160 | **6445.03** | 4233.64 | 41.70 ms | 176.19 ms | 0 | 1 833 697 | **+52.2%**
180 | **7151.54** | 3960.82 | 65.75 ms | 176.97 ms | 0 | 1 891 278 | **+80.5%**
200 | **6821.39** | 3457.21 | 70.57 ms | 262.67 ms | 0 | 1 508 043 | **+97.3%**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Proxy performance confirmation [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #36972:
URL: https://github.com/apache/shardingsphere/issues/36972#issuecomment-3581656305
Thank you for your thorough testing.
This data is highly valuable, and we will analyze it carefully.
However, we are currently swamped with work, and the volume of data is substantial.
We need some time to digest the findings and analyze the performance bottlenecks.
If you happen to have time during the testing process, you could consider doing the following:
1. Capture flame graphs to analyze ShardingSphere's performance bottlenecks.
2. Monitor various MySQL performance metrics, such as I/O and memory usage, to further clarify whether the performance bottleneck lies in ShardingSphere or the database.
You're welcome to share these data—let's work together to pinpoint the issues.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org