Tuning Performance
You can scale out the throughput of the OpenTSDB service by adding tsd nodes. Currently, the Round Robin DNS mechanism is used to load application requests to different tsd nodes. You can optimize the DNS domain name resolution cache on applications to evenly distribute HTTP requests from the applications at better fine-grained rate.
JVM Optimization
- Disable the DNS domain name cache of JVM in code, and use an HTTP connection pool to send requests.
java.security.Security.setProperty("networkaddress.cache.ttl" , "0") private static CloseableHttpClient httpClient;
static {
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setMaxTotal(200);
cm.setDefaultMaxPerRoute(20);
cm.setDefaultMaxPerRoute(50);
httpClient = HttpClients.custom().setConnectionManager(cm).build();
} - Set an interval of the DNS domain name cache of JVM in code to 1 second.
java.security.Security.setProperty("networkaddress.cache.ttl" , "1"); - If you want to make the new IP address be identified without restarting the application after capacity expansion, you can set a connection TTL, but performance will be affected.
HttpClients.custom().setConnectionTimeToLive(600, TimeUnit.SECONDS);
OS Optimization
- Disable the local DNS domain name resolution cache in the Linux OS. Check whether nscd, named, or dnsmasq exists in the /etc/init.d/ directory. If it exists, run the following commands to disable the cache:
/etc/init.d/nscd stop /etc/init.d/named stop /etc/init.d/dnsmasq stop
- Disable the local DNS domain name resolution cache in the Windows OS. Run the following command in cmd:
net stop dnscache
Last Article: Deleting Data
Next Article: Developing GeoMesa Applications
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.