Jump to content


Photo

performance


  • Please log in to reply
6 replies to this topic

#1 bagnallc

bagnallc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 25 July 2006 - 10:53 AM

i am having a bit of a problem at the moment with my pc.

i have been designing a website just using localhost (php/mysql written in notepad) and i have never had any problems with it. as i have done each step i have always being testing and viewing as i go along.

now though all of a sudden whenever i click a link or try and load a page with any database content (even pages which always worked fine), my pc just hangs and when i go into task manager mysqld-nt.exe is always a high number.

are there any settings i need to change or is there something that may have gone amiss?

many thanks


#2 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 25 July 2006 - 02:06 PM

I can't guarantee that I can help, but you can try adding the following to your my.cnf

log-slow-queries
This should be "under [mysqld]
eg
[mysqld]
log-slow-queries
If you don't have a my.cnf, create it and put it in the "data" directory under mysql's installation directory(If you're using MYSQL 4.1 or less). If you're using MYSQl 5 put it in the root of the installation directory. Restart the server.

Load one of the pages that accesses the database and let it run until it's finished (I'm assuming it doesn't completely bring your computer down). Look in the "data" directory for a logfile named something like "host-slow.log" and post the contents if any.

Btw, if you manually query the database using simple queries do you have the same problem? Post your MYSQL version as well.
SELECT VERSION();


#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 July 2006 - 03:36 PM

Assuming it doesn't hang completely, you can also SHOW PROCESSLIST as well.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 bagnallc

bagnallc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 25 July 2006 - 04:59 PM

Hi guys,

thanks for your help.
certainly some of the queries i run (such as the one in the slowlog listed below), are indeed very large ones, but whats troubling me is that in the past this query and many others would run no problem.

it is still the case now that when i initially log in at first, or if i reboot - the pages load instantly.

just once in a while the pc starts to hang and when i go in to task manager i see this mysqld-nt.exe with cpu usage very high. rest of the time its as normal

i guess it does look like it may be the large queries,its just confusing because as i say, previously there was never the same problem.

anyway in the hope you may be able to suggest something the slow log file is as follows

C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt, Version: 5.0.19-nt-log. started with:
TCP Port: 3306, Named Pipe: (null)
Time                 Id Command    Argument
# Time: 060725 17:22:59
# User@Host: root[root] @ localhost [127.0.0.1]
# Query_time: 81  Lock_time: 0  Rows_sent: 2  Rows_examined: 1868379
use horse;
SELECT distinct ifnull(rt_1.rt_1_id, 2) as id, ifnull(rt_1.rt_1_description, 'Non Hand') as rt1
FROM numbers
LEFT JOIN rt_1 ON numbers.rt1_id=rt_1.rt_1_id
JOIN all_details ON numbers.no_id=all_details.no_id





#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 July 2006 - 06:50 PM

Could you post the EXPLAIN output of this query, and the table structures?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#6 bagnallc

bagnallc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 25 July 2006 - 07:06 PM

i have just done a slight restructure on the tables and also ran a few optimize and analyze statements. part of my problem may have been that some tables were myisam and others innodb.

anyway for now i wont take up any more of your time as it seems to have resolved problems

many thanks once again for showing an interest

cheers

#7 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 July 2006 - 07:15 PM

Yup... ANALYZE is quite important.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users