I have WSO2 API Manager v2.2.0 distributed this way, 1 component per server: Traffic, Publisher, Store, Key Manager and Gateway. After instalation, I made the tuning according the docs Performance Tuning and tuning performance, but the max TPS is about 200. With wireshark, I noticed that Gateway open only two simultaneous connections with Key Manager, is this normal behavior? Any help will be appreciated.
Below are my configs:
nhttp.properties
snd_t_core=200
snd_t_max=250
snd_alive_sec=5
snd_qlen=-1
snd_io_threads=4
lst_t_core=200
lst_t_max=750
lst_alive_sec=5
lst_qlen=-1
lst_io_threads=4
http.socket.reuseaddr=true
passthru-http.properties
worker_pool_size_core=400
worker_pool_size_max=500
# worker_thread_keepalive_sec=60
worker_pool_queue_length=-1
io_threads_per_reactor=4
io_buffer_size=16384
http.max.connection.per.host.port=32767
http.socket.reuseaddr=true
catalina-server.xml
maxThreads="750"
minSpareThreads="150"
disableUploadTimeout="false"
enableLookups="false"
connectionUploadTimeout="120000"
maxKeepAliveRequests="600"
acceptCount="600"
api-manager.xml
<APIKeyValidator>
<ServerURL>https://key-manager.net:9443/services/</ServerURL>
<Username>username</Username>
<Password>password</Password>
<KeyValidatorClientType>WSClient</KeyValidatorClientType>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<EnableThriftServer>false</EnableThriftServer>
<ThriftServerHost>localhost</ThriftServerHost>
<!--ThriftServerPort>10397</ThriftServerPort-->
<ConnectionPool>
<MaxIdle>750</MaxIdle>
<InitIdleCapacity>50</InitIdleCapacity>
</ConnectionPool>
<KeyValidationHandlerClassName>org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler</KeyValidationHandlerClassName>
</APIKeyValidator>
There is no such restriction for gateway-keymanager connections. By default, there is a token cache in the gateway and if you're reusing tokens in your load test, it's normal to have a very few connections to keymanager. It's not a problem at all.
Please have a look at WSO2 APIM clustering - how to improve the response time?
As I have mentioned in it, if you enable analytics, you can get an idea about which part of your request flow is causing the most of the latency.