Skip to content
/ kong Public
forked from Kong/kong

The open-source, centralized management layer for microservices and APIs

License

Notifications You must be signed in to change notification settings

edulrc/kong

Repository files navigation

KONG: The API Management Layer

Build Status Build Status

Kong was built for securing, managing and extending APIs & Microservices. If you're building for web, mobile or IoT you will likely end up needing to implement common functionality on top of your actual software. Kong can help by acting as a gateway for any HTTP resource while providing logging, authentication and other functionality through plugins.

Powered by NGINX and Cassandra with a focus on high performance and reliability, Kong runs in production at Mashape where it has handled billions of API requests for over ten thousand APIs.

Core Features

  • CLI: Control your Kong cluster from the command line just like Neo in the matrix.
  • REST API: Kong can be operated with it's RESTful API for maximum flexibility.
  • Scalability: Distributed by nature, Kong scales horizontally simply by adding nodes.
  • Performance: Kong handles load with ease by scaling and using nginx at the core.
  • Plugins: Extendable architecture for adding functionality to kong and APIs.
    • Logging: Log requests and responses to your system over TCP, UDP or to disk.
    • Monitoring: Live monitoring provides key load and performance server metrics
    • Authentication: Manage consumer credentials query sring and header tokens.
    • Rate-limiting: Block and throttle requests based on IP or authentication.
    • Transformations: Add, remove or manipulate HTTP params and headers on-the-fly.
    • CORS: Enable cross origin requests to your APIs that would otherwise be blocked.
    • Anything:Need custom functionality? Extend Kong with your own Lua plugins!

Documentation

Full versioned documentation is available at GetKong.org:

Benchmarks

We set Kong up on AWS and load tested it to get some performance metrics. The setup consisted of three m3.medium EC2 instances; one for Kong, another running Cassandra and a third acting as the target API powered by Lwan. All servers were tuned with the following:

  1. Added fs.file-max=80000 to /etc/sysctl.conf

  2. Added the following lines to: /etc/security/limits.conf

*          soft     nproc          80000
*          hard     nproc          80000
*          soft     nofile         80000
*          hard     nofile         80000

We then load tested the Kong server ramping up from 100 to 1000 concurrent connections. The benchmark generating 65,084 requests over 120 seconds with an average of 542 req/second or about 46,860,480 req/day.

Response Data:

  • Success: 100.00%

  • Error: 0.00%

  • Timeout: 0.00%

  • Fastest Response: 4 ms

  • Slowest Response: 31 ms

  • Average Response: 6 ms

Development

Please see the CONTRIBUTING.md if you would like to have your changes merged into Kong.

  1. Clone the repository and make it your working directory.
  2. Run [sudo] make install

This will build and install the kong luarock globally.

  1. Run make dev

This will install development dependencies and create your environment configuration files:

  • kong_TESTS.yml
  • kong_DEVELOPMENT.yml
  1. Run the tests:
make test-all
  1. Run Kong with the development configuration file:

    $ kong start -c kong_DEVELOPMENT.yml

Makefile Operations

When developing, use the Makefile for doing the following operations:

Name Description
install Install the Kong luarock globally
dev Setup your development environment
run Run the DEVELOPMENT environment (kong_DEVELOPMENT.yml)
seed Seed the DEVELOPMENT environment (kong_DEVELOPMENT.yml)
drop Drop the DEVELOPMENT environment (kong_DEVELOPMENT.yml)
lint Lint Lua files in kong/
coverage Run unit tests + coverage report (only unit-tested modules)
test Run the unit tests
test-all Run all unit + integration tests at once

License

Kong is provided under the MIT License.

About

The open-source, centralized management layer for microservices and APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 95.1%
  • Shell 4.4%
  • Makefile 0.5%