38. Network Socket Usage Analysis
Beginner Mode
Start your terminal to use beginner mode.
Scenario
Network latency issues were reported due to opening too many TCP connections.
Task
Inspect active sockets along with the processes that own them to identify which application is responsible for the excessive connection count. Save all currently active TCP/UDP connections (ESTABLISHED, LISTEN, TIME_WAIT, etc.) output to /tmp/active_tcp.txt
Example
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.1.50:22 192.168.1.100:54321 ESTABLISHED 1234/sshd
tcp 0 0 192.168.1.50:3306 192.168.1.75:41234 ESTABLISHED 5678/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9012/nginx
tcp 0 0 127.0.0.1:6379 127.0.0.1:45678 ESTABLISHED 3456/redis-server
tcp 0 0 192.168.1.50:443 203.0.113.45:12345 ESTABLISHED 9012/nginx
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
Linux 0/29
AWS 0/10
Kubernetes 0/15
CI/CD 0/5
Networking 0/9
Need more practice in this area? Explore more questions →
SAP
Accenture
Coinbase
Adobe
EPAM
Twitch
Amazon
Kayak
Autodesk
Lyft
Revolut
RedHat
Bloomberg
Datadog
Palantir
TCS
HashiCorp
Google
DeutscheBank
GitHub
Apple
Cloudflare
Stripe
Microsoft
NVIDIA
GoDaddy
X
Spotify
Airbnb
Meta
Reddit
Yelp
Okta
Dropbox
Slack
ActivisionBlizzard
Zscaler
Uber
IBM
DeliveryHero
Robinhood
GitLab
Shopify
Samsung
Elastic
Twilio
Netflix
CrowdStrike
Ubisoft
Anthropic
Capital One
Splunk
Intel
AMD
Databricks