In this series, we will see the interview questions that can be asked related to external connectivity.
How will you find the number of connections established with your Databases or SOR or any external services)?
There is a Unix/Windows command “netstat” which displays all the network connections originating from the current server. Issue this command and grep for the host that you are interested to find out established connections.
Example: Assuming you are connecting to an external Services provider whose IP address is “220.127.116.11” then unix command will be:
netstat -an | grep "18.104.22.168" | grep "ESTABLISHED" | wc -l
How will you figure out at real-time whether response time is degrading with your Databases or SOR or any external services)?
There are couple of mechanisms to figure it out:
- There are APM (Application Performance Monitoring) tools such as NewRelic, AppDynamics, Wily Introscope…. which can report at real-time whether response time is degrading or not.
- If you don’t APM, You can instrument application level logging for each external services. So from application logs also response time can be reported.
Approach #1 is better because in approach #2 you will have to login to each production server to compute the average time across all transactions – its slow process. It’s also hard to see the historic average response time.
How will you diagnose the problem if response time has degraded with your external services?
- I will check whether any recent changes were made to the application in production. Changes could be:
- New Code Deployment
- OS patches, Kernel Setting changes
- Network/Firewall settings changes
- Installation of any monitoring tools/agents in the production environment
- JVM setting changes…
- I will take thread dump on the application and analyze them to see whether there are any thread related locking/waiting is happening.
- If no changes have been made on our side, then I will confirm with external services provider whether any changes has been made on them.
- If there are no problem with the external service provider as well, then the problem could be in the environment or Network. I will reach out to my cloud service provider (if you are hosting the application in the public cloud). If the application is hosted in the enterprise’s private data center, I will reach out to them.
- I will instrument packet capture to understand whether there are any problems in the network connectivity.
How will you capture thread dumps? How will you analyze them?
I will use the tools such as JStack, VisualVM to capture thread dumps. For more detail on how to capture thread dumps, please refer to this article.
I will use the tool http://fastthread.io/ to analyze the threading problems. This tool applies several patterns and identifies the problems in the thread dumps, without any human analysis.
What tools are used to do analyze network issues?
- Wireshark is a *great* network protocol analyzer for Unix and Windows. It’s a free tool. It can be used for capturing data at the packet level and analyze them.
- Traceroute is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol (IP) network. It gives information such as the number of hops it takes to reach between your server and the destination. The amount of time spent in each hop. For more details on how to use Traceroute refer to this blog.