{"id":13462476,"url":"https://github.com/louislivi/smproxy","last_synced_at":"2025-05-15T02:09:02.277Z","repository":{"id":37743267,"uuid":"155978483","full_name":"louislivi/SMProxy","owner":"louislivi","description":"Swoole MySQL Proxy 一个基于 MySQL 协议，Swoole 开发的MySQL数据库连接池。 A MySQL database connection pool based on MySQL protocol and Swoole.","archived":false,"fork":false,"pushed_at":"2022-11-13T10:59:56.000Z","size":504,"stargazers_count":1778,"open_issues_count":16,"forks_count":260,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-05-10T18:22:47.761Z","etag":null,"topics":["composer","connection-pool","connections","coroutines","mycat","mysql","php","pool","proxy","smproxy","swoole","swoole-mysql-proxy"],"latest_commit_sha":null,"homepage":"https://smproxy.louislivi.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/louislivi.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-03T11:54:07.000Z","updated_at":"2025-04-25T07:20:11.000Z","dependencies_parsed_at":"2022-07-12T16:44:28.890Z","dependency_job_id":null,"html_url":"https://github.com/louislivi/SMProxy","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2FSMProxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2FSMProxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2FSMProxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louislivi%2FSMProxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louislivi","download_url":"https://codeload.github.com/louislivi/SMProxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259384,"owners_count":22040820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","connection-pool","connections","coroutines","mycat","mysql","php","pool","proxy","smproxy","swoole","swoole-mysql-proxy"],"created_at":"2024-07-31T12:00:48.986Z","updated_at":"2025-05-15T02:08:57.266Z","avatar_url":"https://github.com/louislivi.png","language":"PHP","funding_links":["https://opencollective.com/SMProxy"],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"English | [中文](./README.md)\n```\n  /$$$$$$  /$$      /$$ /$$$$$$$\n /$$__  $$| $$$    /$$$| $$__  $$\n| $$  \\__/| $$$$  /$$$$| $$  \\ $$ /$$$$$$   /$$$$$$  /$$   /$$ /$$   /$$\n|  $$$$$$ | $$ $$/$$ $$| $$$$$$$//$$__  $$ /$$__  $$|  $$ /$$/| $$  | $$\n \\____  $$| $$  $$$| $$| $$____/| $$  \\__/| $$  \\ $$ \\  $$$$/ | $$  | $$\n /$$  \\ $$| $$\\  $ | $$| $$     | $$      | $$  | $$  \u003e$$  $$ | $$  | $$\n|  $$$$$$/| $$ \\/  | $$| $$     | $$      |  $$$$$$/ /$$/\\  $$|  $$$$$$$\n \\______/ |__/     |__/|__/     |__/       \\______/ |__/  \\__/ \\____  $$\n                                                               /$$  | $$\n                                                              |  $$$$$$/\n                                                               \\______/\n```\n# [SMProxy](https://smproxy.louislivi.com/#/en/)\n\n[![release](https://img.shields.io/github/release/louislivi/SMProxy.svg?style=popout-square)](https://github.com/louislivi/SMProxy/releases)\n[![forks](https://img.shields.io/github/forks/louislivi/SMProxy.svg?style=popout-square)](https://github.com/louislivi/SMProxy/network/members)\n[![stars](https://img.shields.io/github/stars/louislivi/SMProxy.svg?style=popout-square)](https://github.com/louislivi/SMProxy/stargazers)\n[![Build Status](https://img.shields.io/travis/com/louislivi/SMProxy.svg?style=popout-square)](https://travis-ci.com/louislivi/SMProxy)\n[![Gitter](https://img.shields.io/gitter/room/louislivi/SMproxy.svg?style=popout-square)](https://gitter.im/louislivi/SMproxy)\n[![license](https://img.shields.io/github/license/louislivi/SMProxy.svg?style=popout-square)](https://github.com/louislivi/SMProxy/blob/master/LICENSE)\n[![SMProxy](https://img.shields.io/badge/SMProxy-%F0%9F%92%97-pink.svg?style=popout-square)](https://github.com/louislivi/SMProxy)\n[![Backers on Open Collective](https://opencollective.com/SMProxy/backers/badge.svg?style=popout-square)](#backers)\n[![Sponsors on Open Collective](https://opencollective.com/SMProxy/sponsors/badge.svg?style=popout-square)](#sponsors)\n\n## Swoole MySQL Proxy\n\nA MySQL database connection pool based on MySQL protocol and Swoole.\n\n## Principle\n\nStore the database connection as an object in memory. When users need to access the database, a connection will be established for the first time. After that, instead of establishing a new connection, free connections will be retrieved from the connection pool when users require. Also, users don't need to close connection but put it back into the connection pool for other requests to use.\n\nAll these things, connecting, disconnecting are managed by the connection pool itself. At the same time, you can also configure the parameters of the connection pool, like:\n\n- The initial number of connections\n- Min / Max number of connections\n- Number of max requests per connection\n- Max idle time of connections\n\n...etc.\n\nIt's also possible to monitor the number of database connections, usage, etc. through its own management system.\n\nIf the maximum number of connections is exceeded, the coroutine will be suspended and wait until a connection is released.\n\n## Features\n\n- Read/Write Splitting\n- Connection Pool\n- SQL92 Standard\n- Coroutine Scheduling\n- Multiple database connections, multiple databases, multiple users...\n- Build with MySQL native protocol, cross-language, cross-platform.\n- Compatible with MySQL Transaction\n- Compatible with HandshakeV10\n- Compatible with MySQL 5.5 - 8.0\n- Compatible with Various Frameworks\n\n## Why This\n\nFor early design reasons, PHP does not have a native connection pool. So the number of database connections will be easily increasing and reaching the maximum when we got lots of requests.\nUsing one of many database middlewares like Mycat will cause some limitations, e.g. batch inserts. And it's also too heavy in most cases.\nSo we created SMProxy using 100% PHP + Swoole, which only supports connection pool and read/write separation, but much more lightweight.\nNot like Mycat, we're trying to build SMProxy with Swoole Coroutine to schedule HandshakeV10 packet forwarding, so we don't have to parse all SQL packets.\nThat really makes SMProxy more stable and reliable.\n\n## Contributing \u0026 Discussing\n\n- Documentation: \u003chttps://smproxy.louislivi.com/#/en/\u003e\n- Community: [![Gitter](https://img.shields.io/gitter/room/louislivi/SMproxy.svg?style=popout-square)](https://gitter.im/louislivi/SMproxy)\n- Issues and Pull requests are always welcome.\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/louislivi/SMProxy/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n## Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/SMProxy#backer)]\n\n\u003ca href=\"https://opencollective.com/SMProxy#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/SMProxy#sponsor)]\n\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/SMProxy/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/SMProxy/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouislivi%2Fsmproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouislivi%2Fsmproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouislivi%2Fsmproxy/lists"}