Skip to content

Commit

Permalink
move backupwiki to wiki/ and add mwjobrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Dec 8, 2022
1 parent c42a53a commit 7daa7c1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
File renamed without changes.
15 changes: 15 additions & 0 deletions wiki/mwjobrunner
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

MW_INSTALL_PATH=/usr/share/webapps/mediawiki
RUNJOBS=$MW_INSTALL_PATH/maintenance/runJobs.php
while true; do
# Job types that need to be run ASAP no matter how many of them are in the queue
# Those jobs should be very "cheap" to run
php $RUNJOBS -q --type="enotifNotify"
# Everything else, limit the number of jobs on each batch
# The --wait parameter will pause the execution here until new jobs are added,
# to avoid running the loop without anything to do
php $RUNJOBS -q --wait --maxjobs=20
# Wait some seconds to let the CPU do other things, like handling web requests, etc
sleep 10
done
25 changes: 25 additions & 0 deletions wiki/mwjobrunner.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Unit]
Description=MediaWiki Job runner
After=php-fpm.service postgresql.service

[Service]
ExecStart=/usr/local/bin/mwjobrunner
Type=exec
Nice=10
User=http
OOMScoreAdjust=200
Restart=on-failure

# from php-fpm.service
PrivateTmp=true
ProtectSystem=full
PrivateDevices=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
RestrictRealtime=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictNamespaces=true

[Install]
WantedBy=multi-user.target

0 comments on commit 7daa7c1

Please sign in to comment.