Solved

php/mysql sites running very slow on IIS

Posted on 2014-01-23
5
2,082 Views
Last Modified: 2014-01-24
Hi,

I've recently installed concrete5 cms on a local server. It uses php and mySQL. It's running very very slow, we are talking about 4-5 second page load times. I've tried to figure out how to speed it up with no luck.

Yesterday I installed a crm on the same server (SuiteCRM) and the same thing is happening. It crawls.

Does anyone have any ideas I could try out to solve this?

Thanks
0
Comment
Question by:JayHine
5 Comments
 
LVL 11

Accepted Solution

by:
Murfur earned 500 total points
ID: 39802734
First things first:
What version Window server?
What version IIS?
What version PHP?
What version MySQL?

Are any other sites running on the same IIS and are they also slow to respond or is it just this one?

The trick is to identify where the slowdown is.
Are there any development plugins running on IIS, e.g. xdebug?
If so, turn them off.

My first route is always to check db connectivity. Where is the MySQL installation, relative to IIS? Same physical server or different? Check the PHP connection string, hostname/ip address and port numbers and make sure they are available and open on the firewall.

I use this script to test the connection and report the speed:

<?php

	$host		= "localhost"; 
	$user		= "root"; 
	$pass		= "root"; 
	$database	= "test"; 

	ini_set("display_errors","0");
	error_reporting(0);
	
#	Get start time
    $start	= microtime();
    $start	= explode( ' ', $start );
    $start	= $start[1] + $start[0];

#	attempt connection
    $conn	= mysql_connect($host, $user, $pass)
	or die( "<div style='color: red;'>Error - Failed to connect to host</div><div>" . mysql_error() . "</div>" );
	echo( "<div>host <i>" . $host . "</i> connected OK</div>" );
#	Get end time
    $end	= microtime();
    $end	= explode( " ", $end );
    $end	= $end[1] + $end[0];

#	calculate total run time
    $total	= ( $end - $start );
    echo( "<div>host connection took " . round( $total, 5 ) . " seconds to complete</div>" );

	$start	= "";
	$end	= "";

#	Get start time
    $start	= microtime();
    $start	= explode( ' ', $start );
    $start	= $start[1] + $start[0];
	
#	attempt to select db
	mysql_select_db( $database, $conn )
	or die( "<div style='color: red;'>Error - Could not find database</div><div>" . mysql_error() . "</div>" );
	echo( "<div>db <i>" . $database . "</i> selected OK</div>" );
	
#	Get end time
	$end	= microtime();
	$end	= explode( " ", $end );
	$end	= $end[1] + $end[0];
	
#	calculate total run time
    $total	= ( $end - $start );
    echo( "<div>db selection took " . round( $total, 5 ) . " seconds to complete</div>" );
	
?>

Open in new window

0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39802782
Here is an older question for something similar.  Part of the issue is a web server handles things a bit different than local and is not set up the same.  If you set up a test folder on your live server, do you get the same results?

http://www.experts-exchange.com/Software/Server_Software/Content_Management/WebBased_CMS/Joomla/Q_27808961.html
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39804152
There is no intrinsic reason for IIS to be slower than Apache.  You have to sort thru the details and find out where things are not up to speed.  But then maybe the application actually is slow.  Do you know of another installation where it runs faster?
0
 

Author Closing Comment

by:JayHine
ID: 39805945
Thanks, that speed script is very helpful as well.
0
 
LVL 11

Expert Comment

by:Murfur
ID: 39805996
You're welcome! So come on then... what was it?

I love a good story & need to know who did it - was it the butler in the library with the candle stick?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

679 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