zhengzheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Cache processes informations #462

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Proposal

In the Process class, the return of the cmdline function is not cached. Is it 
possible to cache it ? Does a command line can change during the process 
execution ?

Thk in advance

Original issue reported on code.google.com by nicolash...@gmail.com on 3 Jan 2014 at 9:08

GoogleCodeExporter commented 8 years ago
Yes it can change (I also wasn't aware), see issue 331.
Perhaps we can investigate whether this is also true on Windows though.

Original comment by g.rodola on 3 Jan 2014 at 11:39

GoogleCodeExporter commented 8 years ago
Sorry, i did not see the issue 331. I understand why the cmdline is not cached. 
Netherless, I just try to see if i can reduce the CPU consumption of Glances 
(http://github.com/nicolargo/glances). Compare to stop, it take arround 10x CPU.

If you have any idea to reduce it...

Thk for your answer !

Original comment by nicolash...@gmail.com on 3 Jan 2014 at 12:52

GoogleCodeExporter commented 8 years ago
Sure I know glances (very nice tool).
What platform are you talking about? Linux?
If it takes too much I think it's fine if you cache the cmdline yourself.
After all it's not something which should change that often.
Same for uids, gids, terminal and possibly others.
You might decide to cache those metrics and, say, update them every 10 secs or 
something.

Original comment by g.rodola on 3 Jan 2014 at 1:41

GoogleCodeExporter commented 8 years ago
Ok i will try to make some benchs. Thk for support.

Original comment by nicolash...@gmail.com on 3 Jan 2014 at 2:29

GoogleCodeExporter commented 8 years ago
psutil has been migrated from Google Code to Github (see: 
http://grodola.blogspot.com/2014/05/goodbye-google-code-im-moving-to-github.html
).
Please do NOT reply here but use this instead:
https://github.com/giampaolo/psutil/issues/462

Original comment by g.rodola on 26 May 2014 at 3:07