papaface Posted September 22, 2009 Share Posted September 22, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/175142-solved-queuing-system-help/ Share on other sites More sharing options...
Altec Posted September 22, 2009 Share Posted September 22, 2009 Cron job, maybe? Quote Link to comment https://forums.phpfreaks.com/topic/175142-solved-queuing-system-help/#findComment-923069 Share on other sites More sharing options...
papaface Posted September 22, 2009 Author Share Posted September 22, 2009 Cron job, maybe? Needs to be done in real time. Quote Link to comment https://forums.phpfreaks.com/topic/175142-solved-queuing-system-help/#findComment-923073 Share on other sites More sharing options...
mikesta707 Posted September 22, 2009 Share Posted September 22, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/175142-solved-queuing-system-help/#findComment-923074 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.