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:
Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Interaction with IT Professionals. Learn more at ziffdavisvts.com
  #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
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Netherland
Posts: 15 darkvalley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 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
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Netherland
Posts: 15 darkvalley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 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: 6
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: 6
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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway