Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:12:30+00:00 2026-05-25T13:12:30+00:00

i have a php script that resize image to three different resolutions on upload.

  • 0

i have a php script that resize image to three different resolutions on upload. When i upload a image it resizes it to 300*300, 80*80, 800*800 and also saves the original file.

The script that i use is the following link https://github.com/blueimp/jQuery-File-Upload/blob/master/example/upload.php

the following images is the system monitor of the server. The first two spikes of CPU history the resize of the image that takes place when the file is uploaded individually. The following are the files that are uploaded from a queue.

CPU WORKLOAD

During this upload the server couldn’t handle other requests. i cannot able to access other pages at that time. either the page loads half or doesn’t load at all or the page loads once the upload is complete.

i need immediate solution to this problem. how to overcome this issue. i have to full for the server. is there any pluggin for apache for image resize or is there a problem with the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:12:31+00:00Added an answer on May 25, 2026 at 1:12 pm

    Even if resizing an image took 100% of CPU during a minute, it would still be possible to do other requests: you are using a multi-processes server on a multitasking operating system (and probably with multiple cores too).

    However, when you start a PHP session, the session is locked: other requests trying to use the same session have to wait until the first request ends.

    This is why you can’t do concurrent requests while the image is being resized.

    You have to close your session before doing long processing (and eventually re-open it after that).

    So, this should fix your problem:

    session_write_close();
    resize_the_image();
    session_start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file (image) upload script in PHP that I use to upload
I have a simple image upload script that uses SimpleImage.php (http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/) to resize and
I have a script that runs to upload an image, then resize it into
I have php script that creates a temporary watermark image for users that are
I have a PHP script that initialises an image gallery. It loops through all
I have a PHP script that can encode a PNG image to a Base64
I have a php script that outputs a random image each time it's called.
I have a PHP script that creates a thumbnail and lists an image gallery.
I have a function in PHP that resizes images into a thumbnail, my image
I have a PHP script that resizes .jpg, .gif, and .png files to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.