MySQL Proxy-core

Source: Internet
Author: User

MySQL Proxy-Core layer (Core) Network Core is built on the basis of socket processing implementation, and the client connection and server connection are associated together. [Connection Life Cycle] connection can be in one of the following four basic protocols: connectauthentificationquerydisconnect can change the default working mode of network core by customizing the plug-in function, then, obtain one of the following three basic plug-in functions: plugin-admin only implements the listen function client plugins only implements the connection function plugin-proxy implements the above two features [Scripting] plugin provided in the source code are implemented corresponding callback function, and exposed it to the scripting layer. Currently, the scripting layer is provided by Lua-a simple, fast, and easy-to-embed scripting language. By exposing most of the internal data to the scripting layer, the corresponding module functions can perform operations on the data uploaded to the scripting layer. [Network Core Layer] The Network engine of MySQL Proxy is designed to process thousands of connections at the same time and is intended to be used for load-balancing and fail-over processing, therefore, it must be able to handle connections elegantly when there are many MySQL backend servers at the same time. The target is locked in the number of connections ranging from 5 k to 10 k. Until MySQL Proxy version 0.7, MySQL Proxy uses purely event-driven, non-blocking network models. Based on the event-driven design, MySQL Proxy only saves a small amount of necessary information for idling connection: that is, it only saves the connection status and waits for the event to arrive. [Threaded Scripting] scripts are usually exquisite and only used for simple decision processing. Most of the work is handled by the network layer. In future versions 0.9, the multi-threaded model supported in the script layer will be used to achieve the simultaneous running of multiple script threads in the form of thread pools. In this way, the script layer can call blocking or slow functions without interrupting the execution of other connections. The lift of global plugin mutex means that we must access the global structure in different ways. Because most of the access occurs at the connection level (that is, the layer of event-threading. global.. Based on this requirement, we will study how to send data between independent Lua-states.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.