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
https://forums.phpfreaks.com/topic/175142-solved-queuing-system-help/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.