Php performance problems in reading json files

Source: Internet
Author: User
A php-written very simple interface that uses json files as a simple database. Will there be performance problems as data increases? How big will there be performance problems? It is expected that the size of json files will grow slowly. Within one year, there should be no more than 5 MB of simple interfaces written in php. json files will be used as simple databases. As data increases, is there a performance problem? How big will there be performance problems? The size of json files is expected to grow slowly. The size should not exceed 5 MB within one year.

Reply content:

A php-written very simple interface that uses json files as a simple database. Will there be performance problems as data increases? How big will there be performance problems? The size of json files is expected to grow slowly. The size should not exceed 5 MB within one year.

Let's talk about my previous test: The 18.2M json contains about 60 entries in every array of 3 W arrays. After deserialization, it will be serialized. The processing time is about 1 second.

In addition, the actual bottleneck of this type of interface will occur on the server's bandwidth, and the network may be blocked if there are more requests for similar interfaces.
However, in terms of your current quantity, there will be no problems in the short term.

I have used several GB of json, So I still have to wait a long time for parsing. It takes dozens of seconds. Not tested.

If the data volume is small within 5 MB, it should be well designed.

The Json of dozens of MB is in seconds. No need to worry about performance issues. As long as your json specification is compact.

Not a problem.
If you are really worried, you 'd better standardize your json file format and use fseek + fread for 1.1 reading.

I use both serialize and unserialize for json. If you do not exceed 5 MB in a year, the volume should not be large.

Only 5 MB. The cache can be used properly to Improve the efficiency.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.