How to implement highly concurrent image Upload

Source: Internet
Author: User
How to implement high-concurrency image Upload through the built-in GD, write a PHP Upload program, found the following problems: 1. eat memory, upload a 2 m image will consume about 60 m of memory; 2. CPU usage: One person uploads a large image (3 MB), and the CPU usage of the PC reaches 50%. 3. the cutting speed is slow, it takes 11 seconds for windows + apache to scale a 3 M image into four images. & nbsp; the result of the above problem is that when multiple users upload images, the image will often fail, how does the service implement high-concurrency image upload?
Through the built-in GD, I wrote a PHP Upload program and found the following problems:

1. memory consumption: uploading a 2 m image consumes about 60 m of memory;

2. CPU usage. one person uploads a large image (3 MB), and the CPU usage of the PC reaches 50%;

3. the cutting speed is slow. it takes 11 seconds for windows + apache to scale a 3 M image into four images;

The result of the above problem is that when multiple users upload images, the image will often fail, and the server CPU and memory consumption is high;

During the test, three people upload files at the same time are basically useless. I don't know if it has something to do with writing;

It is recommended that imagemagic be used before. I have tried it myself and it consumes a lot of resources.

How can I achieve high concurrent image Upload efficiency? I hope you can give me some comments;

(Note: you can give me any comments. it is better to give me some information. this problem is a headache)

------ Solution --------------------
The IIS single machine in Windows is better than APACHE, and multiple machines have no chance to use it, so I don't know.
------ Solution --------------------
The general model configuration is as follows:
Frequency: 2.6
Memory: 2 GB
Set display
4 Mbps bandwidth
Windows XP + Apache2.2 can take up to 2-3 seconds
0-3 seconds for Fedora15 + Apache2.2
Image pixel 2592*1936 1.82 M
------ Solution --------------------
You can run the convert command of imagemagick in the command line to see how it works.

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.