sysown / proxysql Goto Github PK
View Code? Open in Web Editor NEWHigh-performance MySQL proxy with a GPL license.
Home Page: http://www.proxysql.com
License: GNU General Public License v3.0
High-performance MySQL proxy with a GPL license.
Home Page: http://www.proxysql.com
License: GNU General Public License v3.0
In order to compile, GCC 4.7 is required.
Older version do not compile.
Document this.
The current implementation of connection pool is meant to be used only within a thread.
Multiple connection pools should be available, both within the thread and shared.
Two variables need to define the time to lives of a connection:
These need to be defined globally and configurable at runtime.
The optimizer optimizes a lot of functions in Standard_MySQL_Thread, and therefore aren't available at runtime.
It should be possible to use different username/password pair for frontends and backends , and a table to map them
Many threads need to know the current time with a loose precision.
This can be implemented as a global variables update by a single thread: main() seems a good candidate.
Wrong username/password in frontend connection aren't handled, leaving the connection hanging
ACLs should filter user based on their source.
ACLs shouldn't filter user based on their target: routing should take of this
How to reproduce:
mysql -h 127.0.0.1 -P6032
killall -9 mysql
clock_gettime() is used by monolitic_time(), but is not supported by Mac
Child of issue #42
General issue to clean up the code
Currently debug logging goes only to stderr.
This should be enhanced in a way that logging can go to either stderr (like now) or sent to an internal queue where debug entries can be:
a) written on a log file
b) sent to SQLite3
c) both a and b
Periodically, a cleanup function should be called in the per-thread MySQL_Connection_Pool instance to clean up all the expired connections.
To note that in this context "expired" means that have been in the per-thread instance for too long and that now they need to be moved into the shared instance
Class MySQL_Protocol has a pointer to MySQL_Data_Stream pointer, therefore all functions in MySQL_Protocol don't need a MySQL_Data_Stream pointer as argument
In query rules we need an option to disable the query caching as session layer and re-enable it.
This case priority over any query caching rules at query level.
Considering the small overhead in per-thread QC, maybe this could be a flag only for shared QC
See issue #9 for a description of what domains are.
Support for domains needs to be implemented in multiple modules.
Maybe is more appropriate to run multiple instances of ProxySQL (one per domain) instead of having one instance processing all domains
Periodically, a cleanup function should be called in the shared MySQL_Connection_Pool instance to clean up all the expired connections.
To note that in this context "expired" means that have been in the shared instance for too long and that they need to be closed.
This is related to #45 .
If a client issue INIT_DB this is always successful.
Although, when a client run a query and INIT_DB is sent to the database server that can answer with OK or ERR for:
An alternative approach (that should be configurable) is to terminate the session as soon as such errors arise.
These errors can be logged: optionally, configurable
Many threads need to know the current time with a good precision, although calling time functions every time is needed is time consuming.
Each thread could have its own per-thread variable to store current time, updated within the thread when required, and accessible to all the functions.
There should be rules to disable query routing.
This reduces the overhead pf processing the queries.
It also disable connection pool and query caching.
Once disabled cannot be re-enabled as no more processing is performed
Generic parent ticket
Deprecating it adding CHECK in mysql_servers
To update the content of GloMyAuth based on the content of admindb
Almost all members from class MyConnArray should be accessible only from class MySQL_Connection_Pool , in order to hide implementation details
Most of the session variables need to be traced, so if a client specifically set them actions can be taken.
Ex:
Would be more interesting if all the variables are kept local
File is unused, should be deprecated
To update the content of admindb based on the content of GloMyAuth
Details TBD
There is no handler for COM_INIT_DB
It should be possible to connect to admin interface via a text interface
Global object MyHostGroups (class MyHostGroups) has the same name of a private member of its own class. That can be easily confusing
deps/Makefile specifies my_global.h as target of mariadb_client .
Should be my_config.h
Equivalent of SHOW CREATE TABLE in SQLite3 is:
SELECT name AS 'table' , sql AS 'Create Table' FROM sqlite_master WHERE type='table' AND name='%s'
Users should be able to issue HELP commands in the Admin interface
Debugging levels should be set from Admin module
This function is needed to convert resultset from Admin
Very generic issue, to track all commits that add debug information
array2buffer is called in a loop until all the packets are processed, and removed from PtrSizeArray one by one . This can be optimized processing packets in bulk
Remove embedded memcached
Develop it as sysown/memcached-lib
Reintroduce it in the future
Because of issue #27 , objects of MySQL_Connection should be sharable between threads
Configuration should be loaded from Admin.
This issue depends from issue #14
Use FFS (http://en.wikipedia.org/wiki/Find_first_set) to improve performance on memory allocator, using GCC builtin functions __builtin_ffs and __builtin_clz . See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins
Equivalent of SHOW TABLES in SQLite3 is:
SELECT name AS tables FROM sqlite_master WHERE type='table'
The Admin module should start before any other module.
Should be possible to hold the execution of other modules unless they are explicitly started from the admin interface.
Should be even possible to restart other modules without restarting the process.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.