-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move backupwiki to wiki/ and add mwjobrunner
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |