Bad performance file_get_contents with PHP, only on linode
I have a local test vmware image running Ubuntu 8.10 server.
My linode is also Ubuntu 8.10.
They are both set up almost exactly the same (I have a step by step almost script like template to set up a new server).
I'm using php filegetcontents to download (small ~ 15kb) files from websites.
The thing is, that my test vm, behind a crappy bargain basement adsl connection, performs far better than my Linode.
My test machine looks like its doing 1 file per second or thereabouts. My linode looks like its averaging 1 file per 3 seconds.
Any idea what could be the prob? I don't have a high powered test machine, its running under vmware sharing my 2.4ghz laptop. And besides, this isn't exactly disk or cpu killing stuff!
The php.ini files should be the same on both machines. HTTP network timeout in the context on both is set to 1. Linode appears to be pausing for far far longer though. And also appears to be taking longer on successfull tries too.
Is there some kind of bandwidth limiting going on? My linode performance charts in the console seem fine and unloaded.
3 Replies
Already found that I should probably be using curl instead anyway.
That doesn't explain the bad linode performance yet. Though I will change the getcontents function to curl tomorrow and test.
I'm going to rewrite this in python so I can multithread.