Proxysql: ProxySQL over ProxySQL

Created on 19 Dec 2019  路  4Comments  路  Source: sysown/proxysql

Hi everyone,

I am running ProxySQL as sidecar on K8S (Services -> ProxySQL sidecar -> Database server, earch pod have own ProxySQL sidecar). If I scale my pod to over hundred, the connection to database server will increasing and my database server will be overloaded connection (the query per second is not increasing).

I want to recude the connection to database server. Is it possible to run ProxySQL over ProxySQL? services -> ProxySQL sidecar -> ProxySQL -> Database server.

I would appreciate for any help.

Thank you!

Most helpful comment

lol, what?
When you reduce hundreds of proxysql instances with another proxysql service, it's stupid. Then you can in general throw your oversized proxysql service into /dev/null und just use the smaller service and nerver think about what you've did. :)

Because of multiplexing and the performance of proxysql (it can serve a lot of more traffic as our complete read replica cluster), it's sufficient to deploy proxysql only in one separate service.

All 4 comments

lol, what?
When you reduce hundreds of proxysql instances with another proxysql service, it's stupid. Then you can in general throw your oversized proxysql service into /dev/null und just use the smaller service and nerver think about what you've did. :)

Because of multiplexing and the performance of proxysql (it can serve a lot of more traffic as our complete read replica cluster), it's sufficient to deploy proxysql only in one separate service.

The solution envisioned by @vy-nguyentan is actually a solution we at times recommend for specific reasons:

  • simplify the configuration of the client/service
  • HA
  • filter some network traffic

In a solution like this:
services -> ProxySQL sidecar -> ProxySQL main -> Database server.

  • all the services need to know is how to connect to their sidecar, simplyfing a lot their configuration. Also, some application are terrible at handling backends failure
  • the ProxySQL main layer can be highly available, with multiple proxies running at the same time
  • ProxySQL sidecar will automatically handle scenarios in which their backend (ProxySQL main) dies
  • depending from the type of application, it may be very useful to always have a ProxySQL sidecar, as ProxySQL may filter a lot of unnecessary queries executed by the application (endless SET NAMES, pings, SELECT 1 , USE schemaname, etc)
  • if the application doesn't use persistent connections and it created a lot of short lived connections (PHP as an example) it is way more efficient to connect and disconnect to a sidecar than to a remote ProxySQL instance.
    In order words, a sidecar can drastically reduce network latency

Hi @renecannao , Thank you so much for your answser. The last explain helps me a lot.

Closing.
Thanks

Was this page helpful?
0 / 5 - 0 ratings