Jump to content

[SOLVED] Queuing System Help


papaface

Recommended Posts

Hey,

 

I have a website which runs processes invoked by the user on the website.

 

We find that when a lot of people are on the website it causes the processes to get locked up and as such we want to only do a MAX of 20 instances of the process at any given time.

 

We are having an issue implementing this kind of system because sometimes checks are performed on the existing database to see how many processes are queued, but by the time the script gets that information it is out of date.

 

Our table structure is simple

Name | Active

Andrew | 1

Lisa | 0

 

0 in active denotes a process that has NOT been invoked as yet and 1 means that the process is running.

 

Does anyone have any ideas as to what would be the best way to do this? We're confused lol

Link to comment
Share on other sites

Well, every time a process is invoked I would suggest updating the database (which I assume you do) but also checking the database to make sure there aren't the maximum amount of  processes. If there are, then don't let them do the process. If you are going to be using a table, I don't really see another way to make sure that you don't get an overload of processes. Plus, the table won't really be out of date for the specific query, as long as the table gets updated whenever it needs to

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.