GithubHelp home page GithubHelp logo

proxysql-old's People

Contributors

bogdanr avatar hackman avatar renecannao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxysql-old's Issues

Create default hostgroup destination based on username/schemaname

Currently, all the COM_QUERY packets are routed according to a combination of rules that define username, schemaname, query pattern and more.
This means that only queries have a configurable destination, while all other packets are always sent to hostgroup 0.

Enhancement:
should be possible to route any packet that is not a COM_QUERY using rules based on username/schemaname

Use of closed connections lead to undenfined behavior

ProxySQL doesn't correctly handle connections terminated by the mysql backends.
The logic behind mysql_auto_reconnect_enabled and reconnect_server_on_shut_fd() needs to be reviewed .

The only workaround right now is to have a small value for mysql_wait_timeout

Integrate tokenizer into admin interface and make it configurable

Tokenizer should log into SQLite internal DB, and its behaviour should be tunable via configuration file.

Tasks performed by qr_report_thread() should be moved into admin thread.

Possible configurable behaviours:

  • enable/disable switch
  • frequency of dumps
  • save output as aggregate or time series

Option mysql_hostgroups is not documented

mysql_hostgroups=N needs to be configured under [mysql] section in proxysql.cnf . It defines the number of hostgroups.
All the defined hostgroup that are >= mysql_hostgroups-1 are ignored .

TODO:
a) document mysql_hostgroups
b) increase the default value (currently is 2 only)
c) generate errors when are found references to not existing hostgroups

Document debugging

I need to document how to enable/disable debugging, and how to tune what to log.

Implement a garbage collector for l_alloc/l_free

l_alloc and l_free implement a per-thread memory allocator where memory buffers are referenced in stacks.
If a specific workload allocates too much memory blocks in a stack and then release them, they will remain unused.
To avoid memory spikes, we need to implement a garbage collector for l_alloc/l_free

Optimize memory usage for net buffers in data stream

When a data stream is closed, net buffers associated with it aren't deallocated but marked as free and available for other data stream.
This is an architectural decision to speed up the creation of new connections.
Although, it has the drawback that a connections spike can allocate a lot of buffers and these will never be released again.

Some optimizations can be applied, like allocating not more a fixed amount of buffers, or implement a sort of garbage collector to free unnecessary memory.

Make fails on Centos 6.5

Hi Rene,

I'm trying to compile proxysql on a centos 6.5 machine, but I had no luck.
make prints several errors like
mysql_protocol.c:7: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
/usr/include/string.h:399: note: expected ‘const char *’ but argument is of type ‘unsigned char *’

All errors say expected ‘const char *’ but argument is of type ‘unsigned char *’

Then finally
mysql_protocol.c: At top level:
mysql_protocol.c:273: warning: ‘struct rand_struct’ declared inside parameter list
mysql_protocol.c:273: error: conflicting types for ‘proxy_create_random_string’
../include/mysql_protocol.h:22: note: previous declaration of ‘proxy_create_random_string’ was here
mysql_protocol.c: In function ‘proxy_create_random_string’:
mysql_protocol.c:276: warning: passing argument 1 of ‘proxy_my_rnd’ from incompatible pointer type
../include/mysql_protocol.h:23: note: expected ‘struct rand_struct ’ but argument is of type ‘struct rand_struct *’
mysql_protocol.c: At top level:
mysql_protocol.c:282: warning: ‘struct rand_struct’ declared inside parameter list
mysql_protocol.c:282: error: conflicting types for ‘proxy_my_rnd’
../include/mysql_protocol.h:23: note: previous declaration of ‘proxy_my_rnd’ was here
mysql_protocol.c: In function ‘proxy_my_rnd’:
mysql_protocol.c:283: error: dereferencing pointer to incomplete type
mysql_protocol.c:283: error: dereferencing pointer to incomplete type
mysql_protocol.c:283: error: dereferencing pointer to incomplete type
mysql_protocol.c:283: error: dereferencing pointer to incomplete type
mysql_protocol.c:284: error: dereferencing pointer to incomplete type
mysql_protocol.c:284: error: dereferencing pointer to incomplete type
mysql_protocol.c:284: error: dereferencing pointer to incomplete type
mysql_protocol.c:284: error: dereferencing pointer to incomplete type
mysql_protocol.c:285: error: dereferencing pointer to incomplete type
mysql_protocol.c:285: error: dereferencing pointer to incomplete type
make: *
* [obj/mysql_protocol.o] Error 1

I have installed glib2c-devel, openssl-devel, gcc, pcre-devel and glib-devel.

Am I missing something?

Thanks

Leni

Crash when running "\s" twice

How to reproduce it:

$ mysql -u root -h 127.0.0.1 -P6033
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3073370944
Server version: 5.1.30 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \s

mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (i686) using readline 6.2

Connection id: 3073370944
Current database: information_schema
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.30 (Ubuntu)
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 6033
Uptime: 12 days 10 hours 36 min 13 sec

Threads: 2 Questions: 2346446 Slow queries: 0 Opens: 735 Flush tables: 1 Open tables: 182 Queries per second avg: 2.182

mysql> \s

mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (i686) using readline 6.2

Connection id: 3073370944
Current database: information_schema
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.30 (Ubuntu)
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 6033

In error log:
Error: signal 11:
./proxysql(crash_handler+0x19)[0x8103ed9]
[0xb7743400]
./proxysql[0x80fee37]
./proxysql[0x80ff1c5]
./proxysql[0x810019b]
./proxysql(mysql_thread+0x91e)[0x8102b3c]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d4c)[0xb76b5d4c]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb74d8bae]

improve interactive configurator

a) Generate a warning on "localhost"
b) handle host specified in the form ip:port
c) rename the current proxysql.cnf in proxysql.cnf.sample
d) verify that connection parameters work

CLIENT_MULTI_STATEMENTS is not implemented

ProxySQL has CLIENT_MULTI_STATEMENTS disabled, but some clients seem to ignore this (for example, Connector/Net) and assume that CLIENT_MULTI_STATEMENTS is always enabled.
If a client uses such feature even if disabled, it will receive an SQL syntax error starting from the first " ; " .

proxysql stops accepting connections after large query

Issue #19 solved the problem of running large queries that return more than 2GB of data. We have run into a new issue. After running our query which pulls 4gb of data, the data is sorted on the client machine, then a new query is sent to proxysql, but the client is no longer able to connect to proxysql. I verified that the proxysql process is still running on the proxy machine using:

pgrep proxysql | xargs ps
6840 pts/0 Sl+ 0:43 ./proxysql

I then stop the indexing process on the client machine, but can no longer connect to the proxy. The only error the client receives is: Lost connection to MySQL server during query.

If I kill the proxysql process on the proxy machine and restart it, I am able to connect again from the client machine (the above bug happens each time though)

Compile fails in Hebe branch

Following the directions i nthe readme, I get to this step:

mkdir ProxySQL
cd ProxySQL
wget https://downloads.mariadb.org/interstitial/mariadb-native-client/Source/mariadb-native-client.tar.gz
tar -zxf mariadb-native-client.tar.gz
cd mariadb-native-client
cmake . && make

Which fails:

[root@sph20 mariadb-native-client]# cmake . && make
-- Configuring done
-- Generating done
-- Build files have been written to: /ProxySQL/mariadb-native-client
Linking C shared library libmariadb.so
CMakeFiles/libmariadb.dir/my_secure.c.o: In function my_SSL_error': /ProxySQL/mariadb-native-client/libmysql/my_secure.c:43: undefined reference toERR_get_error'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:54: undefined reference to ERR_reason_error_string' CMakeFiles/libmariadb.dir/my_secure.c.o: In functionmy_ssl_end':
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:174: undefined reference to CRYPTO_set_locking_callback' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:175: undefined reference toCRYPTO_set_id_callback'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:177: undefined reference to CRYPTO_num_locks' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:187: undefined reference toERR_free_strings'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:188: undefined reference to EVP_cleanup' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:189: undefined reference toCONF_modules_unload'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:190: undefined reference to CRYPTO_cleanup_all_ex_data' CMakeFiles/libmariadb.dir/my_secure.c.o: In functionmy_ssl_start':
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:111: undefined reference to CRYPTO_num_locks' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:120: undefined reference toCRYPTO_num_locks'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:122: undefined reference to CRYPTO_set_id_callback' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:123: undefined reference toCRYPTO_set_locking_callback'
/ProxySQL/mariadb-native-client/libmysql/my_secure.c:127: undefined reference to OPENSSL_config' /ProxySQL/mariadb-native-client/libmysql/my_secure.c:135: undefined reference toOPENSSL_add_all_algorithms_noconf'
collect2: ld returned 1 exit status
make[2]: *** [libmysql/libmariadb.so.1] Error 1
make[1]: *** [libmysql/CMakeFiles/libmariadb.dir/all] Error 2
make: *** [all] Error 2
[root@sph20 mariadb-native-client]#

This is on Centos 6.5

Prevent servers from being deleted while ONLINE

If any server is deleted from the servers or hostgroups table while in ONLINE state, the server is still being used in active connections.
This behaviour is perhaps not what users expect.

FLUSH HOSTGROUPS should validate the content of "servers" and "hostgroups" against its internal data and if any ONLINE server is missing should return an error

Connections aren't reused

Under certain circumstances (TBD), connections are recycled and ProxySQL continues creating new connections to the backends.
These circumstances need to be identified.

Run proxysql as daemon

I didn't see this in the tasks, but wanted to add it. For a production environment, we will of course want to run proxysql in the background as a daemon. This allows us to setup things like monit to automatically monitor and restart the service should anything go wrong.

Conflicts on query cache

Query cache uses the hash of the query as key. This can lead to conflicts if the same query is executed in two different schemas or from two different users (potentially can also be a security issue). The keys n the query cache should also include schema and username.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.