473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

readfile() and file_get_contents() seem slow

I'm running PHP 5 on a shared VPS. I have a couple little apps that are using file_get_contents() and readfile() for various kinds of (what should be) low-overhead, fast outbound accesses ... that is, I'm handing URLencoded arguments to a couple fast servers and grabbing small patches of XML in return.

When I enter these URL+argument strings in a browser (with the caches turned off), I get effectively instant responses -- so the remote servers are working fine. But when I do the same thing via file_get_contents, the function works properly, but doesn't return data for about five long seconds (i.e., "one one-thousand, two one-thousand ... etc.).

Not that I can peer into the soul of my machine, but I get the impression that what's wrong here is something with function initialization or initial remote-site handshaking. Once data-transfer begins, it seems to occur at network rates. But I have no proof this is what's happening.

It must be a rare problem, because in searching around the wide world of PHP boards, I see no references at all to "file_get_contents being slow." Any idea what's happening here? Should I be doing something to set up a user agent around fopen_wrappers that speeds handshaking? Something odd about the PHP install?
Oct 30 '06 #1
1 4959
vssp
268 100+
Hi friend

What u want can u expline sortly

Sorry i am not clear


vssp
Nov 2 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Yannick Bétemps | last post by:
Hi all, As says the topic, I recently encountered problems with customers using one of my file management applications and being protected in the same time with Norton Internet Security firewall....
12
by: ORC | last post by:
Shouldn't 'ReadFile' block when timeouts are specified even when running in overlapped mode or am I wrong ??? Thanks Ole
2
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The...
5
by: howa | last post by:
are there any advantage in replacing all fread() operations with file_get_contents() ? i.e. file_get_contents("/usr/local/something.txt") VS $filename = "/usr/local/something.txt";
0
by: defogm | last post by:
Hello everyone, I was woundering if PHP "readfile" method consume server bandwidth by the size of the file that is read. I am asking this because I am creating a download script for large file...
4
by: Eric Renken | last post by:
I am trying to do an Overlapped ReadFile on a HID device and it just isn't working for me. The WaitForSingleObject keeps giving me an error "The system cannot find the file specified." This...
9
by: howa | last post by:
Target: To fetch a file using PHP and send to user Method 1: echo file_get_contents( $file_path ); Method 2: readfile( $file_path );
0
by: pac1250 | last post by:
Hi, I am searching how to solve a problem and I dont find it :( I want to access a page from a script behind a proxy : (my script) <-(a proxy with authentification) <-(https serveur with...
15
by: Ketchup | last post by:
Hello everyone, I have been stuck with this problem for quite some time now. I am working in VB.NET, using framework 1.0. I have to keep the compatibility down to the original .NET framework...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.