Skip to content

Commit d1789f3

Browse files
authored
Merge pull request #130 from xrobau/update-queue-worker
Update queue worker docs
2 parents b7a936f + 0271c9d commit d1789f3

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

running-pixelfed/installation.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Using a Unix socket is optional, but may provide faster access since it does not
116116

117117
### Email variables
118118

119-
By default, Pixelfed will not send any emails, but will instead write messages to the Laravel log.
119+
By default, Pixelfed will not send any emails, but will instead write messages to the Laravel log.
120120

121121
To setup a mailer for production deployments, you have several options for supported mail services. Pixelfed currently supports SMTP, Mailgun, Postmark, Amazon SES, and `sendmail` for sending emails to users.
122122

@@ -220,16 +220,19 @@ php artisan migrate --force
220220
```
221221

222222
If you want to enable support for location data:
223+
223224
```bash
224225
php artisan import:cities
225226
```
226227

227228
If you enabled ActivityPub federation:
229+
228230
```bash
229231
php artisan instance:actor
230232
```
231233

232234
If you enabled OAuth:
235+
233236
```bash
234237
php artisan passport:keys
235238
```
@@ -257,11 +260,12 @@ php artisan route:clear
257260
php artisan view:clear
258261
php artisan config:clear
259262
```
263+
260264
:::
261265

262266
### Job queueing
263267

264-
Pixelfed supports both [Laravel Horizon](https://laravel.com/docs/6.x/horizon) and [Queue Workers](https://laravel.com/docs/6.x/queues) to power the job queue. The main difference between Horizon and Queue Worker is the dashboard provided by Horizon as well as advanced load balancing. We recommend using Horizon. Horizon provides a beautiful dashboard which allows you to easily monitor key metrics of your queue system such as job throughput, runtime, and job failures.
268+
Pixelfed supports both [Laravel Horizon](https://laravel.com/docs/11.x/horizon) and [Queue Workers](https://laravel.com/docs/11.x/queues) to power the job queue. The main difference between Horizon and Queue Worker is the dashboard provided by Horizon as well as advanced load balancing. We recommend using Horizon. Horizon provides a beautiful dashboard which allows you to easily monitor key metrics of your queue system such as job throughput, runtime, and job failures.
265269

266270
#### Using Laravel Horizon
267271

@@ -274,7 +278,7 @@ php artisan horizon:publish
274278

275279
If your user has the correct permissions to access Redis and the Pixelfed installation folder, then you can simply run `php artisan horizon` as that user in a terminal. This may be fine, but if you close the terminal then Horizon will also be terminated. Running directly is recommended only in deployments where a terminal can run uninterrupted, e.g. in a VM or using a utility such as GNU Screen or tmux.
276280

277-
If you are running in production, it is more ideal to create a background service for running Pixelfed's task queue. You will need to use a task manager like systemd or Supervisor. For more information, refer to the [Laravel Documentation](https://laravel.com/docs/6.x/horizon#deploying-horizon).
281+
If you are running in production, it is more ideal to create a background service for running Pixelfed's task queue. You will need to use a task manager like systemd or Supervisor. For more information, refer to the [Laravel Documentation](https://laravel.com/docs/11.x/horizon#deploying-horizon).
278282

279283
Most distributions will already come with systemd, so you may set up this unit file at `/etc/systemd/system/pixelfed.service`:
280284

@@ -307,7 +311,7 @@ The example above assumes you are using MariaDB and Nginx, that your distributio
307311
- Replacing `nginx` with `apache`, or replacing `Requires` with `Wants` if you are not running in a production environment
308312
- Replacing `/usr/bin/php` or `/usr/share/webapps/pixelfed/artisan` with the correct paths, e.g. `/usr/bin/php8.1` or `/path/to/pixelfed/artisan`
309313
- Replacing `User=http` to reflect the app user, e.g. `User=pixelfed` or commenting this line in order to run in the system slice.
310-
:::
314+
:::
311315

312316
You can now use systemd to manage Pixelfed like any other background service:
313317

@@ -326,6 +330,7 @@ redirect_stderr=true
326330
stdout_logfile=/usr/share/webapps/pixelfed/horizon.log
327331
stopwaitsecs=3600
328332
```
333+
329334
::: tip
330335
**Using correct paths**
331336

@@ -341,10 +346,14 @@ sudo supervisorctl start pixelfed
341346
```
342347

343348
#### Using Queue Worker
344-
Pixelfed also includes a queue worker that will process new jobs as they are pushed onto the queue. You may run the worker using the `queue:work` command. Note that once the command has started, it will continue to run until it is manually stopped or you close your terminal:
349+
350+
Pixelfed also includes a queue worker that will process new jobs as they are pushed onto the queue. You may run the worker using the `queue:work` command. Note that once the command has started, it will continue to run until it is manually stopped or you close your terminal. This is not recommended for production use, but can be useful to debug any issues with workers.
351+
352+
**Warning**
353+
There are a large number of queues! The list of queues that horizon uses is stored in the [horizon.php](https://github.com/pixelfed/pixelfed/blob/dev/config/horizon.php#L180) configuration file. You should check that all queues in that file are listed on the worker command line, or jobs will not launch!
345354

346355
```bash
347-
php artisan queue:work
356+
php artisan queue:work --queue=high,default,follow,shared,inbox,feed,low,story,delete,mmo,intbg,groups,adelete,move,pushnotify
348357
```
349358

350359
Again, you can use Supervisor or systemd as described above, substituting `horizon` for `queue:work`.
@@ -376,6 +385,7 @@ You may need to replace `/usr/bin/php` or `/usr/share/webapps/pixelfed/artisan`
376385
To translate HTTPS web requests to PHP workers, you will need to configure a reverse proxy.
377386

378387
#### Apache
388+
379389
Pixelfed includes a `public/.htaccess` file that is used to provide URLs without the index.php front controller in the path. Before serving Pixelfed with Apache, be sure to enable the `mod_rewrite` module in your Apache configuration so the `.htaccess` file will be honored by the server.
380390

381391
If the `.htaccess` file that ships with Pixelfed does not work with your Apache installation, try this alternative:
@@ -463,7 +473,7 @@ Make sure to use the `/public` folder as your server root. For example:
463473
```nginx
464474
server {
465475
root /var/www/pixelfed/public;
466-
````
476+
```
467477

468478
If you set root to the install directory (example: `root /var/www/pixelfed;`) Pixelfed will not work.
469479
:::

0 commit comments

Comments
 (0)