ClickHouse / clickhouse-tableau-connector-jdbc

Tableau connector to ClickHouse using JDBC driver
Apache License 2.0
57 stars 9 forks source link

TOO_MANY_SIMULTANEOUS_QUERIES from tableau #61

Open vgcrld opened 8 months ago

vgcrld commented 8 months ago

I get the following from myTableau server and/or Tableau client connecting to the clickhouse when refreshing a tableau report.

Error executing subquery id: "4553" Code: 202. DB::Exception: Too many simultaneous queries. Maximum: 15. (TOO_MANY_SIMULTANEOUS_QUERIES) (version 22.8.20.11 (official build)) , server ClickHouseNode(addr=http:xxx-clickhouse-default-1.core.xxxx.com:443, db=default)@1273894842 Connector Class: clickhouse_jdbc, Version: 0.2.6

Is there a way to throttle how many connections are made at the JDBC (client) level? to avoid this limitation on the clickhouse server? It seems it should be possible to pass JDBC option to throttle how many QUERIES run ?

yurifal commented 8 months ago

Tableau (Server) set the native_api.connection.globallimit to 16 by default (though it could be overwritten by setting the native_api.connection.limit.clickhouse_jdbc to a lower value): https://help.tableau.com/current/server-linux/en-us/cli_configuration-set_tsm.htm

vgcrld commented 8 months ago

Thanks for the quick reply. I saw this option in general web searches but the key is unknown.

I had to use --force-keys in order to get this to go through. Is this correct/expected? It seemed to have added it but then when I try to query it it's not showing anything?

tsm configuration set -k native_api.connection.limit.clickhouse_jdbc -v 4 
Configuration error: At least one configuration value you specified does not match a known configuration key. This applies to the following keys: '[native_api.connection.limit.clickhouse_jdbc]'
Known keys:
native_api.node_limit_checker_disable
native_api.connection_ip_blacklist

Use this parameter to override unknown key error: --force-keys

So I used --force-keys:

tsm configuration set -k native_api.connection.limit.clickhouse_jdbc -v 4  --force-keys

And this appeared to work???

But tsm configuration get in various incantations doesn't seem to show this key has actually been set?

yurifal commented 8 months ago

tsm pending-changes list If any exists then tsm pending-changes apply

If this doesn't help, try setting the native_api.connection.globallimit to a lower than 16.

vgcrld commented 8 months ago

This seems to have fixed it. Thanks for the quick help!!!

yurifal commented 8 months ago

You're welcome.

vgcrld commented 8 months ago

This works great for the Tableau server but if I download the workbook and edit it locally in tableau desktop I still get this error? Is there a way to set native_api.connection.limit.clickhouse_jdbc=4 for tableau desktop?

yurifal commented 8 months ago

Unfortunately, not.

yurifal commented 8 months ago

One more thing that you may want to try (if curious and have a spare time):

1) Make a copy of the clickhouse_jdbc.taco file, rename it to be clickhouse_jdbc.taco.zip then unzip to the ~/My Tableau Repository/Connectors/clickhouse_jdbc folder.

2) Edit the manifest.xml file to change the customisation option on the row 15 to be like this: <customization name='CAP_JDBC_QUERY_ASYNC' value='no'/>

3) start Tableau Desktop in the terminal, with the flag allowing for non-signed taco: /Applications/Tableau\ Desktop\ 2023.2.app/Contents/MacOS/Tableau -DDisableVerifyConnectorPluginSignature=true

Hope this may help. If not, please reply (frankly, I have no idea what else one could do with the Desktop).