Solved

php/mysql sites running very slow on IIS

Posted on 2014-01-23
5
2,002 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Php pie charts 3 26
SSL https .net web site force redirect 3 34
Amazon Redshift 2 25
WP_Query multiple custom taxonomies 5 27
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.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to count occurrences of each item in an array.
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 …

911 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

20 Experts available now in Live!

Get 1:1 Help Now