Solved

PHP / mysql slow on IIS

Posted on 2011-09-09
9
1,122 Views
Last Modified: 2012-05-12
Hi, we have reprogram our site with PHP / MYSQL.  We are hosting our site on IIS 7.5 on windows Server 2008 STD R2.  They have used PHP and MYSQL.  IP6 is disable on the network Interface.  We have a 10mb fiber link.  When someone is going to the site, it takes about 5-10 second to respond.  Any idea what that problem can be?  
0
Comment
Question by:polycorjsp
9 Comments
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36511103
It could be any number of things.  Check the server logs and see if there are any clues there.  

http://portal.smartertools.com/KB/a154/where-are-my-iis-log-files-stored.aspx
http://www.cisco.com/en/US/products/sw/custcosw/ps747/products_tech_note09186a0080094808.shtml

There are many tools that might help, free and cots, such as:
http://www.weblogexpert.com/lite.htm


0
 
LVL 4

Expert Comment

by:vaibhavjaiman
ID: 36511331
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 36516355
You might want to install this free and open source toolset:

Firefox Browser
Firebug Plug-in
YSlow Plug-in

Those can give you some pretty good clues.  But if a simple script takes 5-10 seconds, the server may be involved in error recovery.  Have you tried a simple "hello world" script?  How long would it take to run this script:

<?php phpinfo();
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:polycorjsp
ID: 36540968
Ray Paseur,  it took 2 seconds to load...  I think the problem is the PHP with MySQL..

Is it possible?
0
 

Author Comment

by:polycorjsp
ID: 36541056
Another thing that I have notice is when I'm going to my site
http://www.mysite.com it takes about 10 second and then, the adress is changing to http://www.mysite.com/eng and then, the site is loading

I hope this help!
Thanks!
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 36542310
What is the actual URL of the site.  We might be able to help better if we could look at it and see it in action.

The changing URL should be explained by rewrite rules or header() redirects or meta refresh tags.  Which one is it?  Or are there a combination of those in play?
0
 

Author Comment

by:polycorjsp
ID: 36545023
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 36545487
Looks like the site is built with CakePHP
http://en.wikipedia.org/wiki/Cakephp

With general-purpose web application frameworks you often get a lot of "extra" programming and files.  With the phpinfo() script the response was essentially instantaneous, clearly sub-second.

The phenomenon you mentioned about seeing the site redirect to a page named /eng may be some kind of Cake-related internationalization that is choosing English language.  Unquestionably that is part of the overhead that is making things slower than they need to be.

There are a lot of moving pictures.  They look great but they take time to load and run.  It's a tradeoff -- beauty vs performance.

Firebug reported these.  The speed of the 404 handler might be in play, and in any case it is worth correcting a "not found" condition.
"NetworkError: 404 Not Found - http://www.polycor.com/img/menu/separator.png"
"NetworkError: 404 Not Found - http://www.polycor.com/js/infinitecarousel/images/caption.gif"
"NetworkError: 404 Not Found - http://www.polycor.com/js/infinitecarousel/images/caption.gif"

Using Firefox, Firebug and Yslow here is what I see...
Grade C - load time about 10 seconds.  Total response size 790KB

Key elements:

Make fewer HTTP requests
This page has 10 external Javascript scripts. Try combining them into one.
This page has 3 external stylesheets. Try combining them into one.
This page has 33 external background images. Try combining them with CSS sprites.

Use a Content Delivery Network (CDN)
There are 71 static components that are not on CDN.

Add Expires headers
There are 75 static components without a far-future expiration date.

Compress components with gzip
There are 11 plain text components that should be sent compressed

Put JavaScript at bottom
There are 9 JavaScript scripts found in the head of the document

Configure entity tags (ETags)
There are 70 components with misconfigured ETags
http://en.wikipedia.org/wiki/HTTP_ETag

Use cookie-free domains
There are 12 components that are not cookie-free

Avoid AlphaImageLoader filter
There are a total of 16 filters
0
 

Author Closing Comment

by:polycorjsp
ID: 36574347
Thanks for your help!  I will keep your contact information
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Formating field inside mysql query 2 29
Echo'd values in dropdowns 6 27
PHP Curl Problem 10 31
A responsive image gallery using flexbox 6 11
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question