Solved

php/mysql sites running very slow on IIS

Posted on 2014-01-23
5
2,105 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 53

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

737 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