Learn about Centmin Mod LEMP Stack today
Become a Member

Wordpress Configure Cavalcade for Scaling WordPress wp-cron to 100+ Jobs

Discussion in 'Blogs & CMS usage' started by tininho, Jul 6, 2020.

  1. tininho

    tininho Premium Member Premium Member

    100
    25
    28
    May 22, 2019
    Nordic
    Ratings:
    +68
    Local Time:
    10:44 AM
    https://guides.wp-bullet.com/configure-cavalcade-for-scaling-wordpress-wp-cron-to-100-jobs/

    I followed this guide, with only the following change:

    Code:
    On manager.sh, line 19, change 
    /usr/bin/php
    to /usr/local/bin/php
    I ran into the following problem:

    Code:
    [1176] Worker ret: 1
    [1177] Worker status: Array
    (
        [command] => wp cavalcade run 1177
        [pid] => 4392
        [running] =>
        [signaled] =>
        [stopped] =>
        [exitcode] => 1
        [termsig] => 0
        [stopsig] => 0
    )
    
    [1177] Worker shutting down...
    [1177] Worker out:
    [1177] Worker err: Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress installation exists under.
    
    If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.
    
    If you'd like to continue as root, please run this again, adding this flag:  --allow-root
    
    If you'd like to run it as the user that this site is under, you can run the following to become the respective user:
    
        sudo -u USER -i -- wp <command>
    
    Any preferred way to solve this? My pal Google has some ideas, but none of them worked yet.
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    5:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    whatever wp-cli commands they tell you to run will need to have --allow-root tagged on the end
     
  3. tininho

    tininho Premium Member Premium Member

    100
    25
    28
    May 22, 2019
    Nordic
    Ratings:
    +68
    Local Time:
    10:44 AM
    The wp-cli commands seems to be inside the script files with some variables. I have not yet figured it out, I will update here if I do!
     
  4. tininho

    tininho Premium Member Premium Member

    100
    25
    28
    May 22, 2019
    Nordic
    Ratings:
    +68
    Local Time:
    10:44 AM
    You have to adjust this file humanmade/Cavalcade-Runner

    Example:

    Code:
    # Typically, place in your /lib/systemd/system/ folder and sudo systemctl enable cavalcade.service
    [Unit]
    Description=CavalcadeRunner
    
    [Service]
    TimeoutStartSec=0
    TimeoutStopSec=600
    Restart=always
    ##Change the following 3 lines
    WorkingDirectory=/home/nginx/domains/XX/public/runner/
    User=nginx
    ExecStart=/home/nginx/domains/XX/public/runner/bin/cavalcade
    
    [Install]
    WantedBy=multi-user.target
    
    Obviously it's not optimal to have the cavalcade code on the public folder, but this is just a test.

    And to execute the cavalcade go sudo -u nginx ./cavalcade [rest from the guide]

    Also there is a typo on the above guide, manager.sh / manage.sh (so make sure you choose either one when you add the code).