RE: [PHP] Uptime script
| From: | Andreas D. Landmark | Date: | Tue, 07 Aug 2001 23:34:23 +0000 |
| Subject: | RE: [PHP] Uptime script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61718@lists.php.net to get a copy of this message | ||
At 07.08.2001 03:51, Craig Westerman wrote:
I'm wanting to chart the server load average data displayed when you run The correct way to do that would be to read it straight from the source, (eg. /proc/loadav for linux with procfs). That would be much quicker, and it would also save your server a fork for each reading (unless you are running php as a cgi ;-) nice uptime btw... -- Andreas D Landmark / noXtension I'm running FreeBSD. I'll see if if I can find source as you suggest.for FreeBSD it might be a bit harder, as it doesn't have a /proc/loadav (by default), you might find a /kern/loadav(g) (if you've got kernfs). If you wanna speed up the process (to get a truer number), you'll have to implement your own little solution. Using uptime or w would involve some extra cpucycles, but not too much. The solution in C would be pretty simple, I guess it shouldn't be too hard to hack it into your own little php function either (which would make a neat php function, why didn't I think of that earlier?). The man pages for uptime and getloadavg should give you all the info needed... btw. don't cc you posts to me, I'm still subscribed to the list, and I haven't got any plans of altering that yet... -- Andreas D Landmark / noXtension Real Time, adj.: Here and now, as opposed to fake time, which only occurs there and then.