beanstalkd | Development repository for the beanstalkd cookbook | Infrastructure Automation library
kandi X-RAY | beanstalkd Summary
kandi X-RAY | beanstalkd Summary
## Description This cookbook provides an easy way to install beanstalkd: a fast, general-purpose work queue.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of beanstalkd
beanstalkd Key Features
beanstalkd Examples and Code Snippets
Community Discussions
Trending Discussions on beanstalkd
QUESTION
I'm fan of Laravel-Lumen frameworks. These are so good and nice designed and we can start to implement the apps. But there is a small problem. May be this isn't a problem but in my opinion this is a small problem. Let me explain it.
For example I have a model and I'm using elastic search. When a model created (insert to db) then I'm dispatching a job for indexing this model.
...ANSWER
Answered 2021-Apr-18 at 12:05Have you tried dispatchSync
, I don't know if that's available on Lumen.
Laravel dispatchSync
QUESTION
I would like to implement a queuing mechanism for sending out email via PHPMailer on Amazon EC2. I have set up Beanstalkd correctly on the server and can access it via a console. The mail doesn't seem to go through (trying the various combinations of sample code). In addition do I need to set up a cron job also that would call one of the producer or consumer files?
Does anyone have working code for sending out email via phpmailer/pheanstalk please for Amazon EC2?
Thanks.
...ANSWER
Answered 2020-Oct-07 at 06:56Beanstalkd is great, and I use it myself, however, don't use it for this; It's reinventing the wheel in a bad way. Instead, install a local mail server such as postfix and get that to do your queuing for you. This is also much, much simpler, faster, and easier to control. Email servers are built for managing queues, and they are extremely good at it.
Before you do so, get your mail sending script working – there's no point in even attempting to get something more complex working until you've done that. Also be aware that sending email from EC2 is difficult – Amazon wants you to use their SES service rather than sending directly – you may find sending is blocked altogether. Read the PHPMailer troubleshooting guide to see how to diagnose that.
QUESTION
Good day to you all!
I have a Ubuntu 18.04 LTS server with MySQL 8.0 and ProFTPD 1.3.5e Server.
I used these instructions to set up MySQL authentication for ProFTPd.
https://medium.com/@nico26deo/how-to-set-up-proftpd-with-a-mysql-backend-on-ubuntu-c6f23a638caf
And it works great!
The article above sets up the first user "test" with a UID of 5500 and a GID of 5500. It says that the FTP user directory should be created and chowned to 5500:5500. All very nice.
What it does not say is what to do when the second and third and successive users come along. It is easy to create new users in the database with an INSERT query but should the UID and GID be unique to the new ftp user? If so, is there an easy way to get MySQL to AUTO_INCREMENT the new values above 5500 and 5500 respectively?
Obviously, outside of that query, I will need an auxiliary process that creates the directory and chowns it to the correct UID and GID in the database. My thoughts is as follows:
- INSERT the new ftp user name, password, homedir into the database. This would include what ever UID and GIU need to be inserted.
- Create a beanstalkd task to create homedir for the new ftp user and pass the ftp user name used in the SELECT query.
- The FTP server would check beanstalkd and find out it has a task to perform.
- The FTP server would query the db for the details associated with the new ftp user. (e.g. homedir, UID,GID,etc)
- The FTP server would create the new user's homedir and chown it to the UID and GID in the database.
So to make my questions crystal clear:
- Should the UID and GID be unique to the new ftp user?
- And if so, in the context of ProFTPD auth from MySQL, is there an easy way to get MySQL to AUTO_INCREMENT the new values starting at 5500 and 5500 respectively?
Thanks!
...ANSWER
Answered 2020-Apr-20 at 14:55For auto-incrementing using MySQL, you can define the UID and GID columns, in your users table, as using the AUTO_INCREMENT
MySQL keyword.
In general, it is best to have separate UID and GID values for your users. This helps ensure that filesystem access/permissions to those files are unique/separate. If you re-used the same UID/GID for all your users, it is like having one user with multiple working passwords -- to the filesystem, all the files and directories would be owned by, and accessible to, the same user, regardless of how they logged in. A mistaken configuration would allow one user to access another user's files, because to the filesystem (which only cares about UIDs/GIDs, not names), they are all the same.
As for creating the home directories, this can be automated/done in ProFTPD itself, using its CreateHome
configuration directive.
Hope this helps!
QUESTION
I have a Laravel 5.3 installation running as a pure API application and need to connect from several different applications.
Everything is working fine (after all it's Laravel we're talking about :P), except I can't figure out one thing:
I have a MQTT server that is listening for messages from several devices (doesn't matter what). These messages contain information about a Job Class and method that need to be called on the backend.
I can't call the API directly, the devices simply don't support this (they do, but it's a lot more effort than using MQTT to transmit data). My thought was to push a new job onto the queue defining which Laravel Job Class to call (and which method). The problem is the JSON serialization...
The MQTT server is running on NodeJS, my queues are running on Redis. I remember a Tweet from Taylor where he mentioned that theoretically it could be possible to serialize the JSON needed and push to the queue from outside Laravel, and have the job processed by Laravel.
Anyone any idea how to approach this? Is there a documentation available about the structure of the JSON?
I should also mention that this solution NodeJS push queue, consumed by Laravel worker did not work for me. Same result as above, the job is placed on the queue but discarded without being processed or any errors thrown.
The sample data structure for a queued Event in Redis looks like this:
"{\"job\":\"Illuminate\\\\Broadcasting\\\\BroadcastEvent\",\"data\":{\"event\":\"O:28:\\\"App\\\\Events\\\\NotificationEvent\\\":5:{s:7:\\\"\\u0000*\\u0000name\\\";s:12:\\\"notification\\\";s:4:\\\"data\\\";a:4:{s:4:\\\"testkey\\\";s:14:\\\"testval\\\";s:9:\\\"timestamp\\\";s:19:\\\"2017-02-24 11:07:48\\\";s:5:\\\"event\\\";s:12:\\\"notification\\\";s:5:\\\"class\\\";s:28:\\\"App\\\\Events\\\\NotificationEvent\\\";}s:10:\\\"\\u0000*\\u0000channel\\\";N;s:7:\\\"\\u0000*\\u0000user\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":2:{s:5:\\\"class\\\";s:8:\\\"App\\\\User\\\";s:2:\\\"id\\\";i:2;}s:6:\\\"socket\\\";N;}\"},\"id\":\"XuUKRTf8CTSdzaVgp2gRcvmxQqLcpBUG\",\"attempts\":1}"
Based on that structure, I would think the object (that needs to be serialized) should look similar to this:
...ANSWER
Answered 2017-Feb-26 at 08:51First, note that this is the format of the jobs in the database-based queue in Laravel 5.3. Newer versions of Laravel contains changes.
The payload column should contain a json object of the following format. The job (...\\CallQueuedHandler@call
) can be hard-coded in this scenario. I believe the commandName key is for display-purposes only. The command key, however, is the harder part, it should be a valid object that unserialize() supports. It looks like there are packages available on npm for this purpose, a quick search turned up php-serialization.
QUESTION
I am not that familiar with Beanstalkd.
My list of jobs ready is just increasing over time and I need to discover which tube is processing broken jobs. Is there a way to pause a Beanstalkd tube to try to process the jobs on that queue and let other tubes take priority to be processed?
I am trying to avoid to lose all the jobs on the queue and discover a way to let other jobs to be processed while we fix and find the broken tube.
Thanks for any help.
...ANSWER
Answered 2020-Jan-17 at 16:27To be able to read a job from the tube, you first have to watch
the tube. You can also ignore
a previously watched tube.
Consumers can show interest in tubes by sending the "watch" command; they can show disinterest by sending the "ignore" command. This set of interesting tubes is said to be a consumer's "watch list". When a client reserves a job, it may come from any of the tubes in its watch list.
QUESTION
Answer: My patch to Tinker docs now made it to official Laravel documentation, see the warning frame here: https://laravel.com/docs/6.x/artisan#tinker
Yesterday I noticed this really weird Laravel queue behavior, where the queue always waits for the NEXT job to be scheduled to process the previously scheduled one. Please help me understand what is going on.
...ANSWER
Answered 2018-Oct-31 at 10:10As mentioned in the comment, I think this is just an artefact of using tinker instead of the web interface. I can also reproduce this with tinker but not when doing it within a web request context.
I am not sure why this happens, while tinker is very helpful for debugging purposes it might not be fully capable of handling operations like queuing.
You could file a bug with Laravel or directly at the Laravel tinker project at https://github.com/laravel/tinker
QUESTION
Whenn I send the following sequence via telnet I get EXPECTED_CRLF:
...ANSWER
Answered 2019-Oct-18 at 06:36The issue here was: you can send a text without to encode it in bytes. For the text "hola" is right 4 Bytes, but for "68 6f 6c 61" had to be "11" bytes length.
I misunderstood the protocol, since it is described as "a sequence of bytes" for . Indeed the TCP delivery is a stream of bytes!
- is the job body -- a sequence of bytes of length from the previous line.
So the correct commands are:
QUESTION
Integrated Pheanstalk library in my web app. Created three tubes for three type of jobs. Created a beanstalkd web console also to see the job status. All are working fine.
The issue is, today when I checked the console, one of the tubes is missing. I restarted beanstalkd and it appeared and started working again. Why did this happen?
...ANSWER
Answered 2019-Oct-07 at 10:40Tubes are created on demand whenever they are referenced. If a tube is empty (that is, it contains no ready, delayed, or buried jobs) and no client refers to it, it will be deleted. -- https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt
The tube will be re-created as soon as a new job is put into it. Normally you would watch
all of the tube(s) that a particular worker can deal with, and a reserve
would return the next job from any of the watched tubes based on the specified ordering, or first-come-first-served, as appropriate.
QUESTION
I've set up Laravel (5.5) queuing with Beanstalkd, and I'm using Supervisor. Laravel docs mention the following:
By pushing jobs to different queues, you may "categorize" your queued jobs and even prioritize how many workers you assign to various queues.
but it's never mentioned how to do that. If I have 2 queues on my beanstalkd connection, and I do the following:
...ANSWER
Answered 2017-Nov-15 at 21:25Yes, you can do as you wrote. You can set up one process that will look at email
queue jobs and 4 processed that will look at apprequests
queue.
But you might be also interested in Laravel Horizon that uses Redis as queue driver and can be set up to auto balance queue to increase number of workers for certain queues depending on current load.
QUESTION
I'm new to Laravel, and tried to create my first background task.
Used docs: https://laravel.com/docs/master/queues
Job: (ProcessDatabaseImport.php)
...ANSWER
Answered 2019-Jul-14 at 17:39Sounds like you have two questions.
Running immediately in the browser
As for running immediately, this could happen if Laravel is still using the default sync
driver. Check your /config/queue.php
file and make sure the env()
property is being used. Sync is the default fallback if no queue driver is set in your .env
file, but you could also change this if you want.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install beanstalkd
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page