Jump to content

Sudden slowness when using file operations


iamgregor

Recommended Posts

I don't know what changed, but suddenly all my pages have a 20 to 50 second load delay on my local test server. I was able to finally figure out that the commands that are causing the slowdown are file operations using file or fsockopen.

 

I don't understand what went wrong or how to fix it. Any ideas? I already tried reinstalling Apache, PHP, and MySQL from scratch.

file and getimagesize cause the slowdown and file_exists does not. HELP!

 

Also note, that this didn't have a problem a few days ago and the only thing I've done since then was import a bunch of images to one of my websites via a script I wrote. I don't know how that could have changed web server behavior though.

And an error message that I get:

 

Almost forgot: Here's one of my error messages:getimagesize(http://localhost/teaser.jpg) [function.getimagesize]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Well, I seem to be the only one talking here, but that's ok. I solved most of the problem by taking the time to figure out the filepath on my server (since all the images I'm working with are on my server anyway) and just using file_exists. The problem now is getting the width and height using a different function than getimagesize.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.