Page 1 of 1

Major fragmentation problem

Posted: Wed Jun 11, 2003 10:14 am
by Swede78
I've been using PHP & MySQL now for a about a month and a half. I'm testing and building a site on my computer as a localhost. I have PHP 4.3.1 and MySQL 3.23.56 and IIS 5 on a Win XP Pro machine.

As I've been browsing my test site, I've noticed lately that it seems to be getting slower and slower. A few days ago, it was painfully slow. I'm talking several minutes to load a page that was loading in a second. As I suspected, my hard drive was fragmented, a lot... over 50%.

I defragmented it, and voila... it runs nice and fast again.

After I defragmented it, it was 2.5% fragmented. Now, 2 days later, it's 5% fragmented. I haven't loaded any programs or done anything that would cause such a fast increase in fragmenting.

I tried doing some searches, and haven't found any similar problems with anyone else. Does anyone know why it's doing this? Usually I don't have to defrag my HD for months at a time. Is MySQL causing this? If so, what can I do in my PHP scripts when writing queries to help prevent fragmentation?

Thank you.

Posted: Wed Jun 11, 2003 10:56 am
by volka
the report shows you the files that are fragmented.
Are they located in the mysql-data directory?
How much space is left on that hdd?
Does your application also defrag the mft?

Posted: Wed Jun 11, 2003 11:07 am
by liljester
you might try putting it on a different partition too

Posted: Wed Jun 11, 2003 11:09 am
by cactus
Where is your swap file located ? Same drive/partition ?

Posted: Wed Jun 11, 2003 3:09 pm
by Swede78
The files that are fragmented are "System Volume Information" files, whatever those are? Nothing from my MYSQL directories.

I have over 14 GBs free. I use Norton Utilities Speed Disk to defrag. I don't know what the "mft" is, so I have no idea if NU defrags it.

I could install MySQL on another partition, but only on my computer (Test machine). When I'm ready to put this on the server, I have no choice.

The swap file is actually located on its own partition (1 GB). My computer is an AMD Athlon XP 1800+ 1.5 GHz w/ 512 MB ram.


I was wondering if anyone else experiences these "slow responses" from local testing of php/mysql pages in the browser. I've tested some pages from our server, and they load faster than browsing locally.

Is it possible that it's because my computer isn't running as a true server?

Posted: Wed Jun 11, 2003 3:13 pm
by volka
you might consider relocating your swap file to another partion (even better a physically different harddrive) and set the size to a fix amount.

you should find the settings under Start -> Control Panel -> System -> Performance -> Virtual Memory

Posted: Wed Jun 11, 2003 4:02 pm
by cactus
Have you checked the bugs/reports/coomments on the PHP or mySQL sites, there may be a problem with the Win32 binaries. Other than that I reckon it's because your running them on a desktop.

Do you play games ?

Regards,

Posted: Wed Jun 11, 2003 9:41 pm
by Swede78
The swap file is on its own 1 GB partition. Someone suggested that it could be a memory leak or a spyware program bogging it down.

It seems to come and go. For hours at a time, it'll be very slow. Then it runs nice and quick for awhile. Very strange.

This computer doesn't have any games on it. I try to keep my computer clean of junk (not to say all games are junk). Only programs that I use are on here. For that reason, I doubt I have a spyware program installed.

I really appreciate everyone's help. I think I'll just hope it's my computer trying to be a host to itself. When I'm done, I'll test it on the server, and pursue this only if it happens on the server (win 2k machine).

I just thought of something that it could be while writing that last paragraph.....


that did it! At least temporarily. I guess IIS runs as a background program even as a localhost. In the advanced performance properties under System Properties, I switched processor scheduling from Programs to "Background services". My computer isn't a server, so I'd never keep it like this, but switching it made local browsing run very fast.

Well, that answers that. I feel really stupid. At least I know nothing's wrong with my computer.

Thanks again for your help and time. Hmmm... should I delete all that I wrote above it.... naw.

Posted: Wed Jun 11, 2003 10:46 pm
by Stoker
Bill Gates is just wonderful to allow such things to happen :P