phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Why PHP take more CPU time than MySQL ?

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.1/Ascreaus followed by 3.2/Arsia.

Re: Why PHP take more CPU time than MySQL ?

Postby tornado_mtb » Fri Jul 13, 2012 8:30 pm

drathbun wrote:More RAM helps assuming you use it. Faster CPU would make the php code execute faster.

What sort of site are you running? Meaning how many concurrent users do you have? My server regularly supports hundreds of concurrent users without problems, and I've seen over a thousand concurrent users during peak hours. Do you have more than that? Are people complaining about web site speeds? Half a second should not be that noticeable to your users.


My web have 20M pageview/month , concurrent user at peak time around 1600 user with average 17 pageview/sec , I seen sometime up to 30 pageview/sec . server still handle it. Many core also help this. but the PHP time is what I need to reduce.

welcome to visit my site , http://www.thaimtb.com/forum

Oleg wrote:Scaling php part is a lot easier than scaling the database. If you are looking to improve performance, get a faster processor (clock speed, not core count).

Thanks Oleg, I think so.

bantu wrote:Upgrading to the latest stable PHP branch (PHP 5.3 at this time) is usually a good idea.

If you have the RAM, using memcache should give you another small speedup.

Also, you could use a Debugger/Profiler like XDebug to see where PHP spends most of its execution time. Maybe it is something obvious that can be improved for your workload.


I already use lastest PHP 5.3.?. Is Memcache only for database ,right? not help on php?

I never know about debug . I will study about this. Thanks
tornado_mtb
Registered User
 
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Postby igorw » Fri Jul 13, 2012 9:30 pm

bantu wrote:Upgrading to the latest stable PHP branch (PHP 5.3 at this time)


You mean PHP 5.4? ;-)
User avatar
igorw
Registered User
 
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Why PHP take more CPU time than MySQL ?

Postby bantu » Fri Jul 13, 2012 10:36 pm

igorw wrote:
bantu wrote:Upgrading to the latest stable PHP branch (PHP 5.3 at this time)


You mean PHP 5.4? ;-)

Yes
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
 
Posts: 439
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany

Re: Why PHP take more CPU time than MySQL ?

Postby *Daniel » Sat Jul 14, 2012 1:06 am

I can see tnat with php 5.4 it use less memory than it did on php 5.3. For cache I got xcache installed.
Oleg wrote:This topic's title takes the prize for most errors per word (3 in 4).
*Daniel
Registered User
 
Posts: 165
Joined: Mon Feb 08, 2010 3:42 am

Re: Why PHP take more CPU time than MySQL ?

Postby tornado_mtb » Sat Jul 14, 2012 5:38 am

I use PHP Version 5.3.8 , Is 5.4 faster than 5.3? I concern more speed than memory.
tornado_mtb
Registered User
 
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Postby naderman » Sat Jul 14, 2012 2:29 pm

Yes it is.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1650
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: Why PHP take more CPU time than MySQL ?

Postby tornado_mtb » Sat Jul 14, 2012 2:42 pm

nademan, Is it significant faster? I concern downtime. I use yum update and it not automatic on this upgrade. I donot have experince upgrade php by manual before,
tornado_mtb
Registered User
 
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Postby naderman » Sat Jul 14, 2012 3:14 pm

www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1650
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: Why PHP take more CPU time than MySQL ?

Postby tornado_mtb » Sun Jul 15, 2012 3:24 am


Good example, Thanks.
tornado_mtb
Registered User
 
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Previous

Return to [3.x] Discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron