PHP CSV high load request
I have a PHP server and one CSV 开发者_JAVA技巧file . I need to read the CSV file and send the data to the browser. If an individual request = 10,000 or more (maybe) then reading CSV file from hard disk may be costly. How can I efficiently read CSV file from PHP and send the data to the browser. There is no option to read data form relational db.
Flow pattern:
only browser<------------->PHP(apache)<---------------->CSV
Honestly, a DBMS would be much better at load-balancing and handling multiple requests for the same data than a CSV.
If you honestly and truly cannot use a DBMS, then I'd suggest storing the file in some sort of memory cache, so it isn't reading from the disk every time it goes to retrieve information. Perhaps. also, storing the data in the format it returns to the client would help.
精彩评论