MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 19th, 2002, 01:11 AM
vhshah vhshah is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 2 vhshah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
MySQL Optimization Issue...

I have optimization problems on my web site (URL).

The configuration of the server is as follows:
I have one box running on Linux (RH7.3)/Apache (1.3.26)/PHP (4.2.2) acting as my Web server and a separate box running on Linux (RH7.1)/MySQL (3.23.49a) acting as my database server. Both these are connected using a VPN.

The problem we face is that the site is intermittently slow (comes to almost a crawl at times). The same page that loads sometimes in 5 seconds takes as much as 400 seconds. I checked the traffic stats on the site and noticed that the traffic is almost similar, averaging at about 600 page views in an hour.

To try to debug the problem further, I tried to run a small test on a local server (intranet) in a controlled environment to see some astonishing results:
We created a file with 1 select query (basically selects some rows from the database and displays them in a table). We had 1 user access this file. We noticed that the page loaded in less than a second (expected). We then asked 10 people to access the same page simultaneously. To our surprise the page loaded in 6 seconds for ALL 10 users. If we increased the number of simultaneous users, the load time increased for EVERYBODY.

I am not sure if this is an issue with locks in MySQL OR is this a Apache/PHP related issue.

Any help would be highly appreciated.

Reply With Quote
  #2  
Old November 27th, 2002, 04:41 PM
darkvalley darkvalley is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Netherland
Posts: 16 darkvalley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 57 sec
Reputation Power: 0
Hello,

I think this problem may have something to do with the connection from the database server to the web server. (The webserver processes all requests before outputting results and perhaps have to wait for all results to be provided by the database server.) Is it possible to test the site when you have the database and webservers on one physical place?

(Please keep in mind that this post is merely a brainstorm. I have no experience with MySql... yet)

Reply With Quote
  #3  
Old November 27th, 2002, 05:26 PM
darkvalley darkvalley is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Netherland
Posts: 16 darkvalley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 57 sec
Reputation Power: 0
Perhaps also usefull is an quote posted by someone on another forum..

http://www.experts-exchange.com/Dat...Q_20242198.html

I have to agree with the statament. Poor database design will hang your database with even a couple of users because processing time takes up a lot of time.

Reply With Quote
  #4  
Old November 27th, 2002, 05:58 PM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to Lindset Send a message via AIM to Lindset
have you tried benchmarking your application? with PEAR's benchmark class you can split up your application in different parts, and see how long each of them takes to execute.. by using that class you'll be able to see what you should optimize
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #5  
Old November 27th, 2002, 10:01 PM
vhshah vhshah is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 2 vhshah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Thanks for your posts. I have spent a lot of time trying to find the root cause of the problem and came up with a lot of revelations. There were certain system jobs being fired at the same time when we were firing some cron jobs for batch processing. This used to bring the server down to its knees. We also identified a hardware problem with the ethernet card on the web server. We did further optimization of database tables on mysql. All of this has improved the performance appreciably. An interesting thing that I learnt was about how "resource intensive" multiple echo statements in PHP can be.

Regarding PEAR's benchmarking class, how do I use this? Do I need to install anything on the server (or does it come along with the out-of-the-box install of PHP)? Any instructions of how to use would be great.

Thanks once more.

Reply With Quote
  #6  
Old November 28th, 2002, 12:33 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to Lindset Send a message via AIM to Lindset
I actually not sure.. I've never used it before, I have simply heard others say it is good..

http://pear.php.net/packages.php

Benchmark Class: http://pear.php.net/package-info.php?pacid=53
PEAR Base Class: http://pear.php.net/package-info.php?pacid=14

Good luck!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL Optimization Issue...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek