APISIX is based on etcd to save and synchronize configuration, not relational databases such as Postgres or MySQL.
This not only eliminates polling, makes the code more concise, but also makes configuration synchronization more real-time. At the same time, there will be no single point in the system, which is more usable.
In addition, APISIX has dynamic routing and hot loading of plug-ins, which is especially suitable for API management under micro-service system.
One of the goals of APISIX design and development is the highest performance in the industry. Specific test data can be found here:[benchmark](https://github.com/apache/apisix/blob/master/doc/benchmark.md)
## Why is it that installing APISIX dependencies with Luarocks causes timeout, slow or unsuccessful installation?
There are two possibilities when encountering slow luarocks:
1. Server used for luarocks installation is blocked
2. There is a place between your network and github server to block the 'git' protocol
For the first problem, you can use https_proxy or use the `--server` option to specify a luarocks server that you can access or access faster.
Run the `luarocks config rocks_servers` command(this command is supported after luarocks 3.0) to see which server are available.
If using a proxy doesn't solve this problem, you can add `--verbose` option during installation to see exactly how slow it is. Excluding the first case, only the second that the `git` protocol is blocked. Then we can run `git config --global url."https://".insteadOf git://` to using the 'HTTPS' protocol instead of `git`.
## How to make APISIX listen on multiple ports when handling HTTP or HTTPS requests?
By default, APISIX only listens on port 9080 when handling HTTP requests. If you want APISIX to listen on multiple ports, you need to modify the relevant parameters in the configuration file as follows:
1. Modify the parameter of HTTP port listen `node_listen` in `conf/config.yaml`, for example:
etcd provides subscription functions to monitor whether the specified keyword or directory is changed (for example: [watch](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watch), [watchdir](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watchdir)).
APISIX uses [etcd.watchdir](https://github.com/api7/lua-resty-etcd/blob/master/api_v3.md#watchdir) to monitor directory content changes:
* If there is no data update in the monitoring directory: the process will be blocked until timeout or other errors occurred.
* If the monitoring directory has data updates: etcd will return the new subscribed data immediately (in milliseconds), and APISIX will update it to the memory cache.
With the help of etcd which incremental notification feature is millisecond-level , APISIX achieve millisecond-level of configuration synchronization.
By default, APISIX will read the instance id from `conf/apisix.uid`. If it is not found, and no id is configured, APISIX will generate a `uuid` as the instance id.
If you want to specify a meaningful id to bind APISIX instance to your internal system, you can configure it in `conf/config.yaml`, for example:
## Why there are a lot of "failed to fetch data from etcd, failed to read etcd dir, etcd key: xxxxxx" errors in error.log?
First please make sure the network between APISIX and etcd cluster is not partitioned.
If the network is healthy, please check whether your etcd cluster enables the [gRPC gateway](https://etcd.io/docs/v3.4.0/dev-guide/api_grpc_gateway/). However, The default case for this feature is different when use command line options or configuration file to start etcd server.
1. When command line options is in use, this feature is enabled by default, the related option is `--enable-grpc-gateway`.
Note this option is not shown in the output of `etcd --help`.
2. When configuration file is used, this feature is disabled by default, please enable `enable-grpc-gateway` explicitly.
```json
# etcd.json
{
"enable-grpc-gateway": true,
"data-dir": "/path/to/data"
}
```
Indeed this distinction was eliminated by etcd in their master branch, but not backport to announced versions, so be care when deploy your etcd cluster.