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.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
tornado_mtb
Registered User
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Post by tornado_mtb »

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

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Why PHP take more CPU time than MySQL ?

Post by igorw »

bantu wrote:Upgrading to the latest stable PHP branch (PHP 5.3 at this time)
You mean PHP 5.4? ;-)

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

Re: Why PHP take more CPU time than MySQL ?

Post by bantu »

igorw wrote:
bantu wrote:Upgrading to the latest stable PHP branch (PHP 5.3 at this time)
You mean PHP 5.4? ;-)
Yes

Danielx64
Registered User
Posts: 304
Joined: Mon Feb 08, 2010 3:42 am

Re: Why PHP take more CPU time than MySQL ?

Post by Danielx64 »

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.

tornado_mtb
Registered User
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Post by tornado_mtb »

I use PHP Version 5.3.8 , Is 5.4 faster than 5.3? I concern more speed than memory.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: Why PHP take more CPU time than MySQL ?

Post by naderman »

Yes it is.

tornado_mtb
Registered User
Posts: 8
Joined: Mon May 04, 2009 2:43 pm

Re: Why PHP take more CPU time than MySQL ?

Post by tornado_mtb »

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 ?

Post by tornado_mtb »

Good example, Thanks.

Post Reply