Solved

PHP / mysql slow on IIS

Posted on 2011-09-09
9
1,059 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
Comment Utility
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
Comment Utility
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
 

Author Comment

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

Is it possible?
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:polycorjsp
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
Comment Utility
Thanks for your help!  I will keep your contact information
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now