Increasing PHP Instructions Per Second

Reply

Join Date: Sep 2007
Posts: 1,440
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Increasing PHP Instructions Per Second

 
0
  #1
Oct 5th, 2008
I have made a PHP script which takes days to execute (Web Article Generator) and is there any way that I can make the while loops do more Instructions Per Second using php. Because when executing the script, the servers resources are very low (15% memory & about 9% of cpus) which means the server has plenty of room for a faster execution time. The only thing that I can think of so far is to have a page with 16 iframes all executing a separate while loop of the same php applet but I really need a PHP solution.
If you have any suggestions for increasing the Scripts Instructions Per Second or making the execution time faster then please post them.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Increasing PHP Instructions Per Second

 
0
  #2
Oct 5th, 2008
You can increase the memory limit in PHP which may help with the problem, see http://www.ducea.com/2008/02/14/incr...-memory-limit/

If PHP is installed on a remotely managed server, this may not be an option depending on the build options used.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,440
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Increasing PHP Instructions Per Second

 
0
  #3
Oct 5th, 2008
  1. ini_set('memory_limit','384M');
Surprisingly adding the line above seems to help a little but not tremendously. But is there anything which directly relates to the execution speed or speeds up the execution time to a much faster speed?
Last edited by cwarn23; Oct 5th, 2008 at 1:12 am. Reason: code brackets
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: Increasing PHP Instructions Per Second

 
0
  #4
Oct 5th, 2008
Assume you have hardware that meets to run your script.

If so,
1. Optimize your SQL.
2. Install memcache extension in PHP.

Hope it helps.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,440
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Increasing PHP Instructions Per Second

 
0
  #5
Oct 5th, 2008
Thanks for the replies but I have just found out that it is mainly mysql query's that slow down the script big time. So I will try to use arrays and will try out memcache if memcache is a default php library.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Increasing PHP Instructions Per Second

 
0
  #6
Oct 5th, 2008
Another option is(I've never done it before but it should work) addresses by an article that I read about six months ago regarding php multi threading. This can be done with an <img> tag. For instance, if you want to send any number of parallel threads on their own, you can create an html page with several <img src="processor.php?var1=var1value&var2=var2value" /> and then do a javascript redirect at the bottom to continue processing. It would probably take some working with to perfect the process but if used correctly could probably cut processing time drastically.
Last edited by R0bb0b; Oct 5th, 2008 at 1:41 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC