iamgregor Posted June 2, 2009 Share Posted June 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/ Share on other sites More sharing options...
iamgregor Posted June 2, 2009 Author Share Posted June 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/#findComment-848051 Share on other sites More sharing options...
iamgregor Posted June 2, 2009 Author Share Posted June 2, 2009 It appears that ANY file operation I do that involves a remote file rather than a local one causes great pain. Any ideas of how to fix it? Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/#findComment-848110 Share on other sites More sharing options...
iamgregor Posted June 2, 2009 Author Share Posted June 2, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/#findComment-848116 Share on other sites More sharing options...
iamgregor Posted June 3, 2009 Author Share Posted June 3, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/#findComment-848507 Share on other sites More sharing options...
iamgregor Posted June 3, 2009 Author Share Posted June 3, 2009 Solved the last problem. Getfilesize works with local or url filepaths it seems. Quote Link to comment https://forums.phpfreaks.com/topic/160693-sudden-slowness-when-using-file-operations/#findComment-848765 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.