Jump to content

handling several users at once


CMK08

Recommended Posts

Hello there

 

I am quite new to php and I am working on an application that will let users download several files at once. Basically, the user logs in, then they will see a list of the files available for them - it can be anything between 1 and 300 - they can check the ones that they want to download,  they click the download button, a zip file containing the selected files is created and sent to the browser.

 

I have doubts about how many people can be doing this at the same time. I don't have any exotic functions in my script. Simply a couple of arrays, the zip file is sent to the browser via header('Location: file.zip'). Right now I am just testing this part of the script, but I am really concerned that I will have problems for doing it this way once I start getting hundreds of clicks at the same time.

 

Thanks!

 

CMK08

Link to comment
Share on other sites

I can only think of 2 possible problems:

1) if a lot of people are having files 'zipped' at the same time, that could really slow the server down.

2) if a lot of people are downloading their zip packages at the same time, that could really suck your bandwidth.

 

Both really depend on your server and its net connection...But there probably isn't a better way to do it than you are.

Link to comment
Share on other sites

You could create a queuing system.  Only allow say 10 downloads per minute.  Record each download in a table.  When someone click the download link, check how many downloads have been started in the last 60 seconds.  If that value is above 10, make them wait a minute, otherwise give them the download.

 

Of course you will probably want to make sure there is a line and it's first come, first serve and not first to refresh.  But that's a simple idea.

Link to comment
Share on other sites

  • 2 weeks later...

any suggestions on how I can allow only one download at a time? Is that php or server settings? My aplication is practically ready, I need to address this issue now.

 

Queuing seems like a god idea but I have no idea or to start.

 

thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.