LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-08-2003, 02:25 AM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
php restrictions???


Hi all,

I have a php script for benchmarking my cpu. The problem is that the script says it is a 900mHz processor, but it actually is a 2.2 gHz.

Is there a restriction somewhere in php or apache that can cause the script not to run at 100 %???
 
Old 09-08-2003, 08:21 AM   #2
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Here is the script:


//************************************** // for :CPU Tester //************************************** You must leave the Show Source link and HTML Comment with my name and website in it. //************************************** // Name: CPU Tester // Description:You can get a general idea of the CPU speed of your server. I suppose it could also be modified to see about how high of a load you have if you get a benchmark with the server empty. // By: Harlan Iverson // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq...s/ShowCode.htm //for details. //************************************** <html> <head><title>CPU Speed Test</title></head> <!--Script By Harlan Iverson http://loopy.2y.net--> <? if( isset($HTTP_GET_VARS['source']) ){ highlight_file($SCRIPT_FILENAME); return; } $a=0; //absolutely no code below this line $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; while($a<100000) $a++; $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $total = $endtime-$starttime; //okay to put code again ?> <p>The server machine does 100000 operations in <?= $total ?> Seconds, the CPU is about <?= (100/$total) ?> MHz.<br><br> <p>Note: This will not take advantage of multiple CPUs, and is only an estimated speed. This will change depeding on how busy the server is. <p><a href="<? $SCRIPT_NAME ?>?source=1">Show Source</a> </html>
 
Old 09-08-2003, 08:23 AM   #3
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
Ok, doesn't look that great
Please check: http://www.planet-source-code.com/vb...d=484&lngWId=8
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User name restrictions AndeAnderson Linux - Newbie 4 04-11-2005 03:29 PM
password restrictions Dr Gutiemouth Linux - Security 1 11-04-2004 01:39 PM
Shell Restrictions Equin Linux - Security 1 10-21-2004 11:46 AM
Restrictions X3781 Linux - General 1 01-07-2003 12:55 PM
Safemode restrictions pk21 Linux - General 0 01-07-2003 05:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration