We are having problems on a large website with PHP processes that take to long to execute and that affect the user experience. We are considering using a PHP queue system like beanstalkd in stead of cron jobs and such. Is there somebody that tried this? Any suggestions for a valid implementation? We are considering creating an Opencart module that can be used for heavy processing.
It depends on how it's affecting the user experience. If the user's interface is starting cron jobs for long running tasks, beanstalkd is probably more efficient (though the task itself won't run faster).
If however, you are talking scheduled tasks that are long running and are slowing down the server in general, than beanstalkd won't help.
It's really just used to queue and run tasks, it won't speed up those tasks. But if used properly it can significantly speed up the user interface for certain tasks. For example if the interface sends a large email, the actual sending of the email could be pushed off to beanstalkd and the user interface would not have to wait until it was sent.
If however, you are talking scheduled tasks that are long running and are slowing down the server in general, than beanstalkd won't help.
It's really just used to queue and run tasks, it won't speed up those tasks. But if used properly it can significantly speed up the user interface for certain tasks. For example if the interface sends a large email, the actual sending of the email could be pushed off to beanstalkd and the user interface would not have to wait until it was sent.
I am trying to apply a price markup to the base price of a product. I have a module that calculates the markup based on a backend setup and inserts in the database the new price. This type of task we want to move in background. When the user creates a rule and applies it,everything must be instant for the user the server taking the task in background and inserting the new price.
We still have the problem of the table that is being locked and the site is complete down until the process is done. But this is an other problem.
We still have the problem of the table that is being locked and the site is complete down until the process is done. But this is an other problem.
I'm not sure if beanstalkd would work in your case or not. It would push off the task to a queue to run later so that the interface could return to the user immediately, but the user wouldn't see the updates until after the queue runs the task. A lot of websites do this sort of thing... ie you submit a change and the interface returns immediately but the change itself takes a while to show up. If that works for you beanstalkd could be one possible method to do this.
It can't speed up the task and make it happen any faster though and the method you are using would definitely have to be changed if it's causing table locks that interrupt usage. You must be updating multiple prices to cause that to happen.
It can't speed up the task and make it happen any faster though and the method you are using would definitely have to be changed if it's causing table locks that interrupt usage. You must be updating multiple prices to cause that to happen.
Who is online
Users browsing this forum: No registered users and 56 guests