How to get system statistics in PHP

I am launching a beta version of a web application and I want to record system resource information. system monitors eat too many resources and do much more than I need. What I want to do is get key statistics and register them every time a user logs in.

these are the statistics that interests me:

  • number of users - I already did it
  • system 5 min and 15 min load - php get average load
  • outgoing bandwidth on eth0 - ????
  • free memory - ????

so how can i get outgoing traffic and free memory statistics?

+3
source share
4 answers
+4

* nix, :

free -t -m

MB.

script, crontab.

0

As for network traffic, you can watch ntop .

0
source

On a Linux / Unix-based system, you can read files in / proc /, such as / proc / meminfo and / proc / net / dev (although the netstat -i command output is much easier to parse on a network).

0
source

Source: https://habr.com/ru/post/1759278/


All Articles