Beanstalkd and Beanstalk Console on Ubuntu 14

  • Last Created On Dec 09, 2024
  • 8
0 0

Introduction

Beanstalkd is a work queue server that runs time-consuming tasks asynchronously. It comes in very handy if you manage or develop an application (web, mobile, etc.) that needs to perform time-consuming tasks (like sending emails), and you don’t want your users to wait while the task is running. You can queue tasks with Beanstalkd and have your application move on to the next operation.

Beanstalk Console is a web admin interface for Beanstalkd that was written in PHP. It provides a friendly interface that you can use to see all the jobs and their current states (urgent, ready, reserved, delayed and buried).

Installation

  1. Spin up an AKLWEB HOST server instance running Ubuntu 14.10 x64 and SSH into the server after it’s done provisioning.
  2. Install Beanstalkd.
    sudo apt-get update
    sudo apt-get install -y beanstalkd
    
  3. Install Beanstalk Console by using PHP’s package manager, Composer.
    sudo apt-get install -y php5 php5-cli
    curl -sS https://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer
    composer create-project ptrofimov/beanstalk_console -s dev /app/beanstalk-console
    # Note that "/app/beanstalk-console" can be any directory you choose
    

Running Beanstalk

  1. Make sure that Beanstalkd is running.
    sudo service beanstalkd start
    
  2. Start Beanstalk Console by going to the directory where it was installed and starting a PHP server instance.
    cd /app/beanstalk-console
    php -S [aklwebhost-instance-ip]:7654 -t public
    # *where **[aklwebhost-instance-ip]** is the IP address of the AKLWEB HOST instance you spun up or a domain name pointing to it*
    
  3. Navigate to http://[aklwebhost-instance-ip]:7654. You will be greeted with a “Hello!” screen that contains an “Add Server” button. Click the button and accept the defaults (localhost:11300).

One thing to note here is that you don’t have to use PHP with Beanstalk. Beanstalk is technology agnostic. Also, there are two sides to a queue – adding jobs, and removing jobs. Removing jobs is usually done by what we refer to as a “worker process”. If your technology stack uses PHP, you can use Pheanstalk to perform both tasks.

Conclusion

A queue server that can run jobs in the background asynchronously is a must considering users expect things to happen instantly with your application. Beanstalkd is a tried and tested work queue server that can reduce latency issues with your applications, thereby causing your users to have richer experiences.

Views: 8

Recent Articles

  • How to Install JAX with ROCm Acceleratio...
    96
  • Deploy a PyTorch Workspace on a Vultr Cl...
    71
  • Managing Backup Storage
    82
  • Automating FTP Backups in Windows Server
    71
  • Automating FTP Backups in Linux
    75

Popular Articles

  • Our General Terms & Conditions
    2630
  • Our Privacy Policy
    2475
  • Our Cookies Policy
    275
  • Our Terms of Use
    152
  • How to Install JAX with ROCm Acceleratio...
    96