Average CPU taken for upload/download

How to get details about average CPU taken for upload and download.

I have the same doubt, during file transfer there are 4 processes with name vsftpd in ps -ef output, which process CPU usage are we supposed to find?

which parameter shows the CPU usage in ps -ef

Hey @ayush_pandey you don’t have to use ps -ef to check CPU usage to check cpu usage you can use commands top or htop both of these commands will give you the real time CPU usage and you have to monitor them and to get average for that particular process run that process multiple times and while then monitor cpu usage manually

Which CPU% do I use?
In the output for the top command , there are %cpu in 3 places…I am not sure which one to use.
Do I have to use the PID for vsftpd in order to get the %cpu?
Hints in the right direction Please!!!

Please monitor the way the top is listing processes, it will be evident which one represents the CPU%.

Is it possible that CPU usage is 0%

1 Like

We have to consider the % usage or in Mbs ?

What do you mean- Overall cpu usage or by a particular process?
0% cpu usage overall means your cpu isn’t running but that is not the case if you are able to see something on the screen.
Could be 0 or close to 0 for particular process.

It should be higher than 0% when the file is being transferred.

i tried looking at every single process related to server just to make sure that i am not missing something but cpu usage seems to be 0% for every process

Try running a small process that will take higher cpu and see what happens.

The cpu usage changed very quickly and varied a lot, which value is to be taken?

@Jitender Have tried this https://stackoverflow.com/questions/1221555/retrieve-cpu-usage-and-memory-usage-of-a-single-process-on-linux. I am getting 0 for every parameter it is not giving average

did you use the top command or the ps -p commend?

ps -e -o pcpu,pmem,pid | grep $pid

1 Like

this gives the %cpu and %mem, we need to find the average memory taken during upload/download and increase in memory taken by QBOX server.

first of all v2 to v7 is not working for get command in ftp

1 Like

yup thought so but the answer on stack overflow link says
Note that this gives average CPU usage of the process over the time it has been running.

ps the comments also said the same