data base

Collection and sorting of common MySQL statements

WEB application

Nginx configures Proxy_cache or Fastcgi_cache cache acceleration under multi site

WEB application

Novice Tutorial: Ngnix Installation Details

operating system

Retain (download) rpm package when installing software with yum command on Linux system

data base

Gh ost: online DDL modifying MySQL table structure tool

June 17, 2022

Flyer: a lightweight API development framework based on FastAPI

two thousand eight hundred and twenty-nine zero
Overview We often hear that "the operation and maintenance that will not be developed is not a good luck maintenance". Indeed, in the operation and maintenance work, skilled development experience can make the operation and maintenance work like a duck in water and get twice the result with half the effort! In addition to mastering shell script programming, advanced O&M needs to master a high-level language, such as Python Golang, PHP, Lua, etc. In addition to solving some more complex O&M scenarios, high-level language can also help us better understand the business and do a good job in business O&M, after all, only knowing ourselves and the other can win a hundred battles. I often see many O&M students write interfaces
March 18, 2022

APISIX Advanced Routing 301/302 Jump Configuration

two thousand eight hundred and eighty-one zero
We have an internal website that supports access to two domains at the same time. Recently, due to the need for upgrading, we hope to unify to one domain name, that is, the old domain name will make a 301 jump to the new domain name. You can directly configure an if logic in Nginx, judge the old host and jump to the new domain name. How should this case be configured in APISIX? After looking at the APISIX document, we found that there are two jump plug-ins: redirect and response rewrite. The former can only jump to the uri but not to the protocol host. The latter can modify the return header
February 25 · 2022

Share a typical case of an APISIX gateway returning 502

one thousand six hundred and ninety-three zero
In order to improve the performance of APISIX, the keepalived feature is turned on by default. The default session retention time is 60s. When we deploy the gateway, we also retain this optimization feature. It happens that my upstream service is based on the Gunicorn+FastAPI development framework, and keepalived is also turned on. The default setting for session retention is 5s. There is a problem: within 60 seconds after the gateway and the upstream service establish a connection, the new request will continue to reuse the connection, but the upstream actively closes the connection after 5 seconds, because when the gateway forwards the new request to the upstream, it finds that the connection has been closed, so the above error occurs
December 12, 2021

APISIX O&M optimization solves the problem of long tail requests (time-consuming jitter)

two thousand seven hundred and ninety zero
Since APISIX gateway was popularized and used, there have been many production business accesses in our department. One day, he was pulled into a problem group and was told that there was a problem with the performance of APISIX gateway, and the overall performance was not as good as the previous ZUUL gateway. what? APISIX's performance can't be worse than ZUUL's, can it? Don't talk nonsense. I got a serial request and compared it with the APISIX gateway and the ZUUL gateway in the production environment. The result was surprising! Normally, APISIX takes more time than ZUUL gateway, but AP
November 14, 2021

APISIX O&M Optimization Configuration File Automatic Generation Scheme

three thousand four hundred and twenty-three zero
Configure APISIX in Configmap mode. At the beginning, we used Configmap to deploy APISIX on Tencent Cloud TKE. When the network area becomes more and more open, each TKE cluster needs to define a set of Configmap corresponding to config.yaml, which is very cumbersome to manage. Therefore, here we use Python's Jinja2 plug-in to automatically render APISIX configuration files, which is very convenient on the whole
November 7, 2021

Hong Gateway HMAC Authentication Plug in developed by APISIX Plug in (client SDK attached)

one thousand six hundred and sixty-five zero
Before deciding to fully roll out the use of APISIX, The Kong Gateway has been tried in our production environment for nearly a year, so a large number of API interfaces in the production environment use Kong HMAC authentication. This time, we migrated to the APISIX gateway. In order to reduce the transformation work of the client, we decided to migrate the HMAC authentication plug-in of the Kong gateway to APISIX, and at the same time, take the HMAC authentication of Hong as the unified authentication scheme of the subsequent API interface
November 3, 2021

APISIX plug-in development refined speed limiting plug-in

two thousand seven hundred and forty-eight zero
In actual business scenarios, The APISIX speed limit is too general to meet the business requirements. In the end, we modified ourselves on the basis of the limit count plug-in and redesigned a speed limit mechanism to set differentiated access speed limits for different consumers based on different services to meet the more refined speed limit requirements of the production environment
October 28, 2021

APISIX Advanced Routing Forwards requests through the Body parameter

three thousand nine hundred and twenty-seven zero
APISIX's advanced routing is very powerful. You can do forwarding routing based on arbitrary variables, such as header Cookie, querystring parameters, etc. There is a very abnormal usage in our history: routing based on the value of a parameter in the Body, that is, different values should be forwarded to different backend IPs: PORT (this problem is mainly due to lazy service splitting, which does not promote the tail left by the client's modification request)
March 30 · 2020

Create personal password management service based on Bitwarden

nine thousand one hundred and sixty zero
Overview In our life and work, we will be exposed to more than N apps or web pages. Because not every service can bind accounts with a one click login method similar to QQ, so there are more than N account passwords. Recording passwords has become a headache for us. The password that is too simple or too single is easy to be hit by the database or "stripped", while the password that is too complex is difficult to remember. Therefore, there are many software services on the market to help us record passwords, such as 1password Lastpass, etc. These software can automatically capture the password protection of the account submitted by us
October 4, 2019

Docker Remote API Introduction and Practice Sharing: Haproxy Remote Management

four thousand eight hundred and thirty-four thirteen
All friends familiar with Docker know that, Docker can open the remote control API. By default, it listens to TCP 2375 port. It has a very rich interface methods that can be used to remotely control Docker Daemon for many operations. The Docker version iterates quickly, so different versions of API documents are also provided officially. This article briefly introduces some common operations and best practices based on the latest v1.40. 1、 Installing DockerCentos can directly use Yu
July 7, 2019

CloudFlare Edge Computing Workers: Blog Jumps to the Middle Page

three thousand two hundred and sixty-four forty-two
On April 27, I was lucky to participate in the Meng Xin, a big bull of CloudFlare, gave a lecture on the course "The Latest Edge API of CloudFlare, Creating a Serverless Architecture", which was very fruitful. Because this course is very grounded, and most of the content is in practice, rather than some people who just talk about theory and spell out PPT when sharing, they are confused. When sharing, it is the same way, but when you really try it, it is a different way, duang~, Of course, another reason is that Zhang Ge's blog is also using Clos
June 23, 2019

Docker image sharing: One click deployment of MariaDB Galera Cluster cluster

seven thousand one hundred and eighty-two twenty-nine
MariaDB Galera Cluster (hereinafter referred to as MGC cluster) is a set of relational storage architecture that realizes multi master, real-time data synchronization and strong consistency on the MySQL innodb storage engine. The business level does not need to do read and write separation, and the database read and write pressure can be distributed to each node according to the established rules, which is fully compatible with MariaDB and MySQL in terms of data