Post by hypemedia » Wed Jan 29, 2014 11:57 pm

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.

Active Member

Posts

Joined
Fri Aug 17, 2012 5:39 pm

Post by tarheit » Thu Jan 30, 2014 6:39 am

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.

New member

Posts

Joined
Wed Jan 22, 2014 5:16 am

Post by hypemedia » Fri Jan 31, 2014 10:32 pm

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.

Active Member

Posts

Joined
Fri Aug 17, 2012 5:39 pm

Post by tarheit » Sat Feb 01, 2014 6:21 am

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.

New member

Posts

Joined
Wed Jan 22, 2014 5:16 am

Post by hypemedia » Sun Apr 06, 2014 3:13 pm

We have integrated the beanstalkd for most of the heavy stuff and the experience for the enduser is nice as they don't know what happens in the backend and the system looks snappy for them.

Active Member

Posts

Joined
Fri Aug 17, 2012 5:39 pm
Who is online

Users browsing this forum: No registered users and 56 guests