1

My web server is running on PHP 5 and MySQL 5.0. When I copied an application developed in CAKE PHP, the server is extremely slow. The organization who provides the files are running the same application without any problem. The versions deployed in their server are also the same. I have no way to contact them and except one operation (clicking on a link) others running smoothly.

Please tell me, do I need to change something in php.ini? Since it is working smoothly on one server, it is nothing regarding to the application code. It takes around 40 seconds to load a page (having some database operations) on a Xeon server with 1 Mbps (equal up and down) Internet connection.

Server is running on RHEL 5.

3
  • Voted to be moved to ServerFault.
    – Anonymous
    Feb 9, 2011 at 5:13
  • 1
    What do you mean "except one operation (clicking on a link)"? can you be more certain? Feb 9, 2011 at 7:36
  • 2
    What do you mean "i have no way to contact them"? contact whom? Files? Hosting provider? System developers? Feb 9, 2011 at 7:37

4 Answers 4

2

Normally its occurs when php generate many warnings and notices messages, if the display_errors are disabled you not seeing. Apache is ocuppied saving logs. Check logs in /var/log/apache2/

1

Is the app/cache directory writeable? If not, CakePHP needs to regenerate it's class files for every page load. That takes a lot of resources.

This is just one possibility. Definitely also check out the suggestions from the other people who answered.

0

Well all these answers as well as closing votes are just trash.
I can't believe such ignorance and guesswork can be ever exist.

This is perfectly legitimate programming question, however poorly asked and even worst answered.

Imagine you are sick and come to doctor.
- A am sick! - says you - Give me something. Doesn't it scare you if doctor would give you some drugs, without any diagnostics?
Just in case, thinking, "It helped some person and may be help this one". Doesn't is sound weird?. But you all here acting exactly the same way! But it shouldn't be this way.

One have to investigate first, give a diagnosis, and only then order treatment.

Every damned one here have to learn what profiling is.
And speak of nothing but profiling.

You have to investigate, what particular reason causing such performance impact. Every answer here should be teaching you how to do that.

40 seconds is awful lot of time, no "fine tuning" recipes can help. There is some serious misconfiguration somewhere. But a web-server is not a single system. it consists of many parts - database, web-server, programming code, static files, etc. So, you have to find certain part that causing such slowness. Only then you can ask for certain treatment.

So, first of all you have to be certain - what page load slow? What does it do? What parts of it runs slow? Using microtime(1) function you can measure tume consuming by various parts of this page. So, you can locate problem part. And so on.

You can consult here about all these steps, but you have to give all possible feedback, not just asking I am sick, give me cure My server is slow, what to do.

2
  • Doctors also refer to specialists. Feb 9, 2011 at 8:09
  • And your doctor analogy doesn't hold up. Normally you're standing in front of the doctor, which means s/he has an "interaction" with you during the diagnosis. The OP hasn't been seen for (8 hours at the time of this comment) to provide more information or have an "interaction" with us. Try dropping into your doctors office and yelling "A am sick!" and then leave and never come back. Think he'll diagnose what's wrong?
    – GregD
    Feb 9, 2011 at 13:17
0

Change your mysql settings to log everything in the slow query log. Add %D to your apache log config. Use firefox as the client and install firebug.

Read the logs and look at the page waterfalls in firebug.

(hint: I'd start by making sure you've not got unresolvable DNS names in any of the code/config)

If the answer isn't obvious, then ask here providing details of what you found.

You must log in to answer this question.