nethogs | Linux 'net top' tool
kandi X-RAY | nethogs Summary
kandi X-RAY | nethogs Summary
Linux 'net top' tool
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nethogs
nethogs Key Features
nethogs Examples and Code Snippets
Community Discussions
Trending Discussions on nethogs
QUESTION
I'm trying to build a script in Linux (Debian 10) that shows the net usage (%) of a process passed as an argument. This is the code, but there isn't any output:
...ANSWER
Answered 2021-May-21 at 21:48What I'm doing wrong?
What you're doing wrong is single-quoting $ProcessName
while wanting this to be parameter-expanded. To get the expansion, just don't quote there, e. g.:
QUESTION
I don't even know what to call this... When you open nethogs in terminal it opens up a window when you exit the whole terminal content are intact (certainly no screen clear was used). Need to what to call this and how to do this. Thank you
...ANSWER
Answered 2020-Apr-24 at 19:43I think all the trick is made by ncurses
From nethogs README:
Nethogs depends on ncurses for the text-based interface
QUESTION
Currently, I have a script that adds lines into .bashrc
. Here are a few of the lines. I feel this is not the most elegant way to do this. Is there a better way?
ANSWER
Answered 2018-Nov-13 at 06:57cat <>~/.bashrc
blabla
blabla
blablablalba
EOF
QUESTION
I have 2 servers. Server A is where I have scripts that download html files from websites and then insert those texts into a MySQL server that its on server B.
Server B, at least for now, is just for Writing to MySQL, we dont read (select) to that server.
Data is downloaded using a PHP Script and another PHP Scrips opens a connection to server B a writes to MySQL using mysqli library.
By the way, the only service (that matters) running on server B is MySQL.
My problem is that server B bandwidth consumption is almost Symmetric, every data that comes in is the same that comes out, I asume its going back for some reason to server A, but I cant understand why o what is going back. If you are doing only INSERTS, the Received data should go UP and the SENT data should stay low. but this is no happeing. (See attached image showing the transfered data for MySQL)
I have use VNStat and Nethogs to try debugging but I cant figure it out. For some reason MySQL is transferring some data back to server A which is costing me a lot of BW.
Any ideas of why this could be happening?
Best Regards.
...ANSWER
Answered 2018-Jan-20 at 20:19After a long night analyzing my PHP code I found a Loop with a Mysql query inside that at first I thought it was a light query, which it was but if you add up every cicle of the loop you get a lot of data being sent to the MySQL server.
I created a better way to do that and now the BW consumption is at least half.
QUESTION
I want to write a script that recognizes if someone is streaming data from my samba server (i.e. music is playing - or not). For that, I've come up with a script like this:
...ANSWER
Answered 2017-Sep-04 at 23:28This is wrong:
QUESTION
In our C/S based online game project, we use TCP for network transmission. We include Libevent, utilise a bufferevent for each connection to handling with the network I/O automatically.
It works well before,but the lagging problem comes to the surface recently. When I do some stress testing to make the network busier, the latency becomes extremely high, several seconds or more. The server sinks into a confusing state:
- the average CPU usage decreased (0%-60%-0%-60% repeat, waiting something?)
- the net traffic decreased (nethogs)
- the clients connected to server still alive (netstat & tcpdump)
It looks like something magically slowed all system down, but new connection to server responded quit in time.
When I changed the protocol to UDP, it works well on the same situation: no obvious latency, the system runs fast. Net traffic is around 3M/S.
The project is running on an Intranet. I also tested the max download speed, nearly 18M/S.
I studied part of Libevent's header files and ducumentations, tried to setup a rate limit to all connections. It did some improvements, but not completely resolved the problem even though I had tried several different configurations. Here is my parameters: read_rate 163840, read_burst 163840, write_rate 163840, write_burst 163840, tick_len 500ms.
Thank you for your help!
...ANSWER
Answered 2017-Jan-12 at 04:20TCP = Transmission Control Protocol. It responds to packet loss by retransmitting unacknowledged packets after a delay. In the case of repeated loss, it will exponentially back off. Take a look at this network capture of an attempt to open a connection to host that is not responding:
It sends the initial SYN, and then after not getting an ack for 1s it tries again. After not getting an ack it then sends another after ~2s, then ~4s, then ~8s, and so on. So you can see that you can get some serious latency in the face of repeated packet loss.
Since you said you were deliberately stressing the network, and that the CPU usage is inconsistent, one possible explanation is that TCP is waiting to retransmit lost packets.
The best way to see what is going on is to get a network capture of what is actually transmitted. If your hosts are connected to a single switch, you can "span" a port of interest to the port of another host where you can make the capture.
If your switch isn't capable of this, or if you don't have the administrative control of the switch, then you will have to get the capture from one of hosts involved in your online game. The disadvantage of this is that taking the capture will possibly alter what happens, and it doesn't see what is actually on the wire. For example, you might have TCP segmentation offload enabled for your interface, in which case the capture will see large packets that will be broken up by the network interface.
I would suggest installing wireshark to analyse the network capture (which you can do in real time by using wireshark to do the capture as well). Any time you are working with a networked system I would recommend using wireshark so that you have some visibility into what is actually happening on the network. The first filter I would suggest you use is tcp.analysis.flags
which will show you packets suggestive of problems.
I would also suggest turning off the rate limiting first to try to see what is going on (rate limiting is adding another reason to not send packets, which is probably going to make it harder to diagnose what is going on). Also, 500ms might be a longish tick_len
depending on how your game operates. If your burst configuration allows the rate to be used up in 100ms, you will end up waiting 400ms before you can transmit again. The IO Graph is a very helpful feature of Wireshark in this regard. It can help you see transmission rates, although the default tick interval and unit are not very helpful in this regard. Here is an example of a bursty flow being rate limited to 200mbit/s:
Note that the tick interval is 1ms and the unit is bits/tick, which makes the top of the chart 1gb/s, the speed of the interface in question.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nethogs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page