Giter Site home page Giter Site logo

apache / apisix Goto Github PK

View Code? Open in Web Editor NEW
13.7K 316.0 2.4K 38.87 MB

The Cloud-Native API Gateway

Home Page: https://apisix.apache.org/blog/

License: Apache License 2.0

Lua 79.50% Makefile 0.79% Shell 11.21% Perl 1.26% Go 3.39% Python 1.63% Java 0.64% Dockerfile 0.28% Open Policy Agent 0.15% JavaScript 1.07% C 0.09%
apigateway cloud-native nginx api-management luajit api-gateway microservices apisix api loadbalancing

apisix's Introduction

Apache APISIX API Gateway

APISIX logo

Build Status License Commit activity Average time to resolve an issue Percentage of issues still open Slack

Apache APISIX is a dynamic, real-time, high-performance API Gateway.

APISIX API Gateway provides rich traffic management features such as load balancing, dynamic upstream, canary release, circuit breaking, authentication, observability, and more.

You can use APISIX API Gateway to handle traditional north-south traffic, as well as east-west traffic between services. It can also be used as a k8s ingress controller.

The technical architecture of Apache APISIX:

Technical architecture of Apache APISIX

Community

  • Mailing List: Mail to [email protected], follow the reply to subscribe to the mailing list.
  • Slack Workspace - invitation link (Please open an issue if this link is expired), and then join the #apisix channel (Channels -> Browse channels -> search for "apisix").
  • Twitter Follow - follow and interact with us using hashtag #ApacheAPISIX
  • Documentation
  • Discussions
  • Blog

Features

You can use APISIX API Gateway as a traffic entrance to process all business data, including dynamic routing, dynamic upstream, dynamic certificates, A/B testing, canary release, blue-green deployment, limit rate, defense against malicious attacks, metrics, monitoring alarms, service observability, service governance, etc.

  • All platforms

    • Cloud-Native: Platform agnostic, No vendor lock-in, APISIX API Gateway can run from bare-metal to Kubernetes.
    • Supports ARM64: Don't worry about the lock-in of the infra technology.
  • Multi protocols

    • TCP/UDP Proxy: Dynamic TCP/UDP proxy.
    • Dubbo Proxy: Dynamic HTTP to Dubbo proxy.
    • Dynamic MQTT Proxy: Supports to load balance MQTT by client_id, both support MQTT 3.1.*, 5.0.
    • gRPC proxy: Proxying gRPC traffic.
    • gRPC Web Proxy: Proxying gRPC Web traffic to gRPC Service.
    • gRPC transcoding: Supports protocol transcoding so that clients can access your gRPC API by using HTTP/JSON.
    • Proxy Websocket
    • Proxy Protocol
    • HTTP(S) Forward Proxy
    • SSL: Dynamically load an SSL certificate.
  • Full Dynamic

    • Hot Updates And Hot Plugins: Continuously updates its configurations and plugins without restarts!
    • Proxy Rewrite: Support rewrite the host, uri, schema, method, headers of the request before send to upstream.
    • Response Rewrite: Set customized response status code, body and header to the client.
    • Dynamic Load Balancing: Round-robin load balancing with weight.
    • Hash-based Load Balancing: Load balance with consistent hashing sessions.
    • Health Checks: Enable health check on the upstream node and will automatically filter unhealthy nodes during load balancing to ensure system stability.
    • Circuit-Breaker: Intelligent tracking of unhealthy upstream services.
    • Proxy Mirror: Provides the ability to mirror client requests.
    • Traffic Split: Allows users to incrementally direct percentages of traffic between various upstreams.
  • Fine-grained routing

  • Security

  • OPS friendly

    • Zipkin tracing: Zipkin
    • Open source APM: support Apache SkyWalking
    • Works with external service discovery: In addition to the built-in etcd, it also supports Consul, Consul_kv, Nacos, Eureka and Zookeeper (CP).
    • Monitoring And Metrics: Prometheus
    • Clustering: APISIX nodes are stateless, creates clustering of the configuration center, please refer to etcd Clustering Guide.
    • High availability: Support to configure multiple etcd addresses in the same cluster.
    • Dashboard
    • Version Control: Supports rollbacks of operations.
    • CLI: start\stop\reload APISIX through the command line.
    • Standalone: Supports to load route rules from local YAML file, it is more friendly such as under the kubernetes(k8s).
    • Global Rule: Allows to run any plugin for all request, eg: limit rate, IP filter etc.
    • High performance: The single-core QPS reaches 18k with an average delay of fewer than 0.2 milliseconds.
    • Fault Injection
    • REST Admin API: Using the REST Admin API to control Apache APISIX, which only allows 127.0.0.1 access by default, you can modify the allow_admin field in conf/config.yaml to specify a list of IPs that are allowed to call the Admin API. Also, note that the Admin API uses key auth to verify the identity of the caller. The admin_key field in conf/config.yaml needs to be modified before deployment to ensure security.
    • External Loggers: Export access logs to external log management tools. (HTTP Logger, TCP Logger, Kafka Logger, UDP Logger, RocketMQ Logger, SkyWalking Logger, Alibaba Cloud Logging(SLS), Google Cloud Logging, Splunk HEC Logging, File Logger, SolarWinds Loggly Logging, TencentCloud CLS).
    • ClickHouse: push logs to ClickHouse.
    • Elasticsearch: push logs to Elasticsearch.
    • Datadog: push custom metrics to the DogStatsD server, comes bundled with Datadog agent, over the UDP protocol. DogStatsD basically is an implementation of StatsD protocol which collects the custom metrics for Apache APISIX agent, aggregates it into a single data point and sends it to the configured Datadog server.
    • Helm charts
    • HashiCorp Vault: Support secret management solution for accessing secrets from Vault secure storage backed in a low trust environment. Currently, RS256 keys (public-private key pairs) or secret keys can be linked from vault in jwt-auth authentication plugin using APISIX Secret resource.
  • Highly scalable

  • Multi-Language support

    • Apache APISIX is a multi-language gateway for plugin development and provides support via RPC and Wasm. Multi Language Support into Apache APISIX
    • The RPC way, is the current way. Developers can choose the language according to their needs and after starting an independent process with the RPC, it exchanges data with APISIX through local RPC communication. Till this moment, APISIX has support for Java, Golang, Python and Node.js.
    • The Wasm or WebAssembly, is an experimental way. APISIX can load and run Wasm bytecode via APISIX wasm plugin written with the Proxy Wasm SDK. Developers only need to write the code according to the SDK and then compile it into a Wasm bytecode that runs on Wasm VM with APISIX.
  • Serverless

    • Lua functions: Invoke functions in each phase in APISIX.
    • AWS Lambda: Integration with AWS Lambda function as a dynamic upstream to proxy all requests for a particular URI to the AWS API gateway endpoint. Supports authorization via api key and AWS IAM access secret.
    • Azure Functions: Seamless integration with Azure Serverless Function as a dynamic upstream to proxy all requests for a particular URI to the Microsoft Azure cloud.
    • Apache OpenWhisk: Seamless integration with Apache OpenWhisk as a dynamic upstream to proxy all requests for a particular URI to your own OpenWhisk cluster.

Get Started

  1. Installation

    Please refer to install documentation.

  2. Getting started

    The getting started guide is a great way to learn the basics of APISIX. Just follow the steps in Getting Started.

    Further, you can follow the documentation to try more plugins.

  3. Admin API

    Apache APISIX provides REST Admin API to dynamically control the Apache APISIX cluster.

  4. Plugin development

    You can refer to plugin development guide, and sample plugin example-plugin's code implementation. Reading plugin concept would help you learn more about the plugin.

For more documents, please refer to Apache APISIX Documentation site

Benchmark

Using AWS's eight-core server, APISIX's QPS reaches 140,000 with a latency of only 0.2 ms.

Benchmark script has been open sourced, welcome to try and contribute.

APISIX also works perfectly in AWS graviton3 C7g.

Contributor Over Time

visit here to generate Contributor Over Time.

Contributor over time

User Stories

Who Uses APISIX API Gateway?

A wide variety of companies and organizations use APISIX API Gateway for research, production and commercial product, below are some of them:

  • Airwallex
  • Bilibili
  • CVTE
  • European eFactory Platform
  • European Copernicus Reference System
  • Geely
  • HONOR
  • Horizon Robotics
  • iQIYI
  • Lenovo
  • NASA JPL
  • Nayuki
  • OPPO
  • QingCloud
  • Swisscom
  • Tencent Game
  • Travelsky
  • vivo
  • Sina Weibo
  • WeCity
  • WPS
  • XPENG
  • Zoom

Landscape

  

APISIX enriches the CNCF API Gateway Landscape.

Logos

Acknowledgments

Inspired by Kong and Orange.

License

Apache 2.0 License

apisix's People

Contributors

agile6v avatar bisakhmondal avatar bzp2010 avatar dabue avatar dependabot[bot] avatar firstsawyou avatar guitu168 avatar jbampton avatar jiangfucheng avatar juzhiyuan avatar kayx23 avatar kingluo avatar leslie-tsang avatar membphis avatar monkeydluffy6017 avatar moonming avatar nic-chen avatar okaybase avatar pottekkat avatar revolyssup avatar shreemaan-abhishek avatar shuaijinchao avatar sn0rt avatar soulbird avatar spacewander avatar sshniro avatar tokers avatar tzssangglass avatar xuruidong avatar yiyiyimu 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  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

apisix's Issues

feature: put all of the Lua code and libraries to apisix home folder.

$ tree -L 1  apisix
apisix
├── apisix-0.5-0.rockspec
├── bin
├── CODE_OF_CONDUCT.md
├── conf
├── COPYRIGHT
├── deps            # dependent Lua files and libraries
├── doc
├── go
├── LICENSE
├── logs
├── lua
├── Makefile
├── README_CN.md
├── README.md
├── t
└── utils

plugin: rate limit

implemented:

limit-req
limit-count

waiting todo:

  • limit-conn
  • limit-traffic

bug: failed to fetch data from etcd

there is no data under /services and /upstreams.

2019/05/31 04:03:54 [error] 5370#5370: *875 [lua] config_etcd.lua:194: failed to fetch data from etcd: /usr/share/lua/5.1/resty/etcd.lua:240: bad argument #1 to 'ipairs' (table expected, got nil), etcd key: /services, context: ngx.timer
2019/05/31 04:03:59 [error] 5370#5370: *879 [lua] config_etcd.lua:194: failed to fetch data from etcd: /usr/share/lua/5.1/resty/etcd.lua:240: bad argument #1 to 'ipairs' (table expected, got nil), etcd key: /upstreams, context: ngx.timer

centos 7: install shell

sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

sudo yum install git automake autoconf gcc pcre-devel libtool gcc+ gcc-c++ \
    luarocks etcd openresty -y

sudo service etcd start

luarocks install apisix

curl http://127.0.0.1:2379/v2/keys/apisix/routes -X PUT -d dir=true
curl http://127.0.0.1:2379/v2/keys/apisix/upstreams -X PUT -d dir=true
curl http://127.0.0.1:2379/v2/keys/apisix/services -X PUT -d dir=true

curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT -d value='
{
	"methods": ["GET"],
	"uri": "/index.html",
	"id": 1,
	"plugin_config": {
		"limit-count": {
			"count": 2,
			"time_window": 60,
			"rejected_code": 503,
			"key": "remote_addr"
		}
	},
	"upstream": {
		"type": "roundrobin",
		"nodes": {
			"39.97.63.215:80": 1
		}
	}
}'

sudo apisix init
sudo apisix start

$ curl -i http://127.0.0.1:9080/index.html

plugin.lua crash

图片

I think, should not be caused by fetching things from an empty table, whatevery the etcd config bad or right

Roadmap of Version 0.6

We are collecting new features for apisix version 0.6. If you have any suggestions, please leave a message here.

  • support HTTPS: #152
  • support for custom certificates for HTTPS: #152
  • add one more port for admin API: #194
  • health check and circuit-breaker
  • dashboard: #170
  • opentracing, implemnt Zipkin first: #204

feature: support WebAssembly in apisix.

在 apisix 的生态圈中,目前主要是通过 Lua 来完成的,但由于 Lua 语言自身比较弱以及生态比较匮乏,是否可以通过其他语言来弥补短板,就非常有意义了。

貌似 WebAssembly 比较符合目前需求,它已经支持目前比较流行的语言主要有 C/C++、JavaScript 和 Golang 等,为这些语言提供了新的运行机制。

另外对于 serverless 以及边缘计算场景,更需要多语言的支持。

In the apisix ecosystem, it is mainly done by Lua, but because the Lua language itself is weak and the ecology is scarce, it is very meaningful to make up for the short board through other languages.

It seems that WebAssembly is more in line with current needs. It already supports the more popular languages, such as C/C++, JavaScript and Golang, providing a new operating mechanism for these languages.

In addition, for serverless and edge computing case, more need for multi-language support.

Collecting test samples in complex situations

在当前的测试结果中,还缺少复杂情况的测试。这需要一份真实的测试样本,包含各种不同 uri 、method 组合,在 uri 中最好还包含一些有正则匹配的情况,等待您的建议。

In the current test results, there is still a lack of testing for complex situations. This requires a real test sample, including a variety of different uri, method combinations, and it is best to include some regular matching cases in the uri, waiting for your suggestion.

benchmark: v0.5

single worker

0.4 version benchmark: #36 (comment)

this version: dc12e8d

# 1route + 1 upstream + no plugin

$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT \
    -d value='{"methods":["GET"],"uri":"/hello","id":1,"plugin_config":{},"upstream":{"type":"roundrobin","nodes":{"127.0.0.1:80":1,"127.0.0.2:80":1}}}'

$ wrk -d 5 http://127.0.0.2:9080/hello
Running 5s test @ http://127.0.0.2:9080/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   518.57us  180.42us   8.61ms   91.77%
    Req/Sec     9.52k   659.49    10.89k    66.67%
  96627 requests in 5.10s, 18.15MB read
Requests/sec:  18944.55
Transfer/sec:      3.56MB

$ wrk -d 5 http://127.0.0.2:9080/hello
Running 5s test @ http://127.0.0.2:9080/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   520.49us  145.73us   9.11ms   86.06%
    Req/Sec     9.50k   825.08    10.93k    77.00%
  94465 requests in 5.00s, 17.74MB read
Requests/sec:  18888.80
Transfer/sec:      3.55MB
# 1route + 1 upstream + 2 plugins

$ curl http://127.0.0.1:2379/v2/keys/apisix/routes/1 -X PUT     -d \
    value='{"methods":["GET"],"uri":"/hello","id":1,"plugins":{"limit-count":{"count":200000000,"time_window":60,"rejected_code":503,"key":"remote_addr"},"prometheus":{}},"upstream":{"type":"roundrobin","nodes":{"127.0.0.1:80":1,"127.0.0.2:80":1}}}'

$ wrk -d 30 http://127.0.0.2:9080/hello
Running 30s test @ http://127.0.0.2:9080/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   595.39us  178.51us  22.24ms   90.63%
    Req/Sec     8.33k   642.91     9.46k    59.80%
  499149 requests in 30.10s, 124.22MB read
Requests/sec:  16582.76
Transfer/sec:      4.13MB

$ wrk -d 30 http://127.0.0.2:9080/hello
Running 30s test @ http://127.0.0.2:9080/hello
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   598.23us  188.41us  15.63ms   91.48%
    Req/Sec     8.29k   672.68     9.52k    72.00%
  495022 requests in 30.00s, 123.19MB read
Requests/sec:  16500.29
Transfer/sec:      4.11MB

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.