Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Very slow PHP-website: what is the source reason of this?

PHP-website is very slow. What is the source reason for this

12:31 pm on Feb 28, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 28, 2012
votes: 0

Our PHP-website with a small MySQL-database connected to it, is very slow, especially when there are more users surfing, like in the weekends.
But still: no big numbers (about 7 users per day).

Related questions:
  1. how can I get to know the source reason of the slow response times?
    I would like to know where the bottleneck is located.
  2. Does there exist a tool to test/benchmark this (possibly FREE, not too complex to install & to use)?

The programming team is telling me that bad response times are due to bad hosting;
the hosting provider is telling me that it is due to bad programming...

All comments are more than welcome!

6:01 pm on Feb 28, 2012 (gmt 0)

Senior Member from KZ 

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 10, 2005
posts: 2936
votes: 24

Hi jje007, first of all a Warm Welcome to WebmasterWorld!

It can be either a bad host or bad programming. I assume that you are using shared hosting which makes it difficult to check performance on the server itself.

The first thing you may want to do is check if you see delays when loading images from the server. If this is the case, it is certainly your hosting which causes the problem because the loading of images is not dependent on your PHP script programming.

The second thing to test is to use a medium complex PHP script without MySQL calls which generates a page and see if that causes problems. If this is the case, the server itself is overloaded.

The last thing to test is using a PHP page which uses the MySQL back-end to read or store data. Often in shared hosting configurations the MySQL server is run on a separate server and that server may be overloaded or the network connection between the servers may be slow.
10:36 am on Mar 1, 2012 (gmt 0)

New User

5+ Year Member

joined:Feb 28, 2012
votes: 0

Thank you Lammert, for your warm welcome & your help!

Contacts provider
Based on your suggestions, I just got in touch with my provider.
There are indeed 2 servers used for our website: a hosting server & a db server. He is telling me that the shared server might be a very little slower because of security redirects. I suppose this is normal, isn't it?
He asked me to do a trace route, in order to check the connection between my PC & provider (via internet). I answered him, that we get a lot of complaints from users about the slow website, from all over Europe. So the issue is not related to my desk PC specifically. He answered me that it could be related to a Europe-network-problem for Internet, which is a bit hard to believe for me.
Still, I will do a trace route, and ask my partner (located about 50 km away) to do the same.

And to answer your first question:
yes, we use shared hosting. I contacted the provider several times, and he said that dedicated hosting would diminish our problem. But I am not sure, as our problem could also be due to bad programming, as you mention.
On the other hand, we are told by our provider that we dispose of unlimited bandwith. I actually am not sure of this.

On your first point:
what do you mean by 'delays when loading images from the server'? Should I download just an image? So the URL would be www.sitename/images/imagename.png?

On your second point:
In fact, every page uses mySql-call (mySQL is already used for fetching the content of the page). So I am not sure that I dispose of a php-script without sql.

On your third point:
Every PHPpage is using MySQL. And every PHPpage goes slow. We also saw that when we are using our Admin-tool (which does a lot of MySQL-activities), the site is even slower. So the connection to the MySQL-server, or the MySQL-server itself could indeed be the bottleneck!
I wonder how I can be sure of this specifically.

Remaining question:
Does there exist a tool that I can use for measuring the different times, in order to find the time-consuming bottleneck?
With this, I could prove something towards programmers/providers.

I guess you receive more questions than answers from me (-; I can tell you that we are very busy with this as this issue is a big worry for us!
1:38 pm on Mar 1, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

Slow hosting.

Inefficient htaccess rules.

Overuse of includes.

Poor database connection.

Inefficient database query.
2:31 pm on Mar 1, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 30, 2007
votes: 0

First of all make sure you do not have any DNS problems with your server. The next part I would check is the mysql. You could rule it out by uploading some basic html and see if it takes long time to load.

Also the google webmaster tools will show what googlebot reports as average load times, latency spikes etc. If the report shows your site is fast you may want to check your javascripts or other external resources that are pulled in.
6:10 am on Mar 2, 2012 (gmt 0)

Junior Member

joined:Feb 18, 2012
votes: 0

I think there is problem in website hosting or may be problem in database connection.
8:57 am on Mar 2, 2012 (gmt 0)

New User

5+ Year Member

joined:Oct 15, 2009
posts: 40
votes: 0

You should try getting firebug and yslow plugins for firefox. It will help you determine where the issue is and make some recommendations for fixes.

It only looks at one page at a time and gives a rating. It then lists the issues you should look at. It will also give you the load times of the various objects on the page.

It won't tell you anything about your database connection just how the front end is being loaded.

If you have php mysql you can also look at caching techniques that will reduce the number of SQL calls to the database. I think the php tool / plugin is called APC, but I couldn't get it working myself.

Another option is to use a CDN. I think there are a few free ones..

Good luck

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members