Learn about Centmin Mod LEMP Stack today
Become a Member

Wordpress Problem when add new site wordpress site

Discussion in 'Blogs & CMS usage' started by YuchiRO, Sep 3, 2016.

  1. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    Hi

    I had problem when add new worpdress site using option 22. Very slow, extrem slow with warning:

    PHP:
    PHP Warning:  Error while sending QUERY packetPID=24133 in /home/nginx/domains/mysite.com/public/wp-includes/wp-db.php on line 1858
    I had 9 running wordpress site on this server, and this is 10th site.

    Thanks.
     
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    To troubleshoot, you need to check the the wp vhost log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the initial install log.

    Also post output for the following

    Code (Text):
    php -v
    php --ini
    php --m
    
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    Code (Text):
    PHP Warning:  Error while sending QUERY packet. PID=24133 in /home/nginx/domains/mysite.com/public/wp-includes/wp-db.php on line 1858

    Actually line 1858 of wp-includes/wp-db.php is mysql query related at WordPress/wp-db.php at 4.6 · WordPress/WordPress · GitHub so probably your mysql server was slow and/or busy that's why

    did it eventually install and setup wordpress for you though ?
     
  4. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    Code:
    PHP Warning:  Error while sending QUERY packet. PID=7551 in /home/nginx/domains/mysite.com/public/wp-includes/wp-db.php on line 1858
    Warning: Error while sending QUERY packet. PID=7551 in /home/nginx/domains/mysite.com/public/wp-includes/wp-db.php on line 1858
    Installing WP Super Cache (1.4.8)
    Downloading install package from https://downloads.wordpress.org/plugin/wp-super-cache.1.4.8.zip...
    Using cached file '/root/.wp-cli/cache/plugin/wp-super-cache-1.4.8.zip'...
    Unpacking the package...
    Installing the plugin...
    Plugin installed successfully.
    Activating 'wp-super-cache'...
    Success: Plugin 'wp-super-cache' activated.
    
    ....
    Complete install wordpress more than a hour, each plugin cost alot of time to complete install.
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    I see. Do you have any automated wordpress database backup scripts or wp backup plugins scheduled around that time ? could be locking your mysql server during backups so the query needed to wait until backups completed

    log and output for commands posted at Problem when add new site wordpress site | Centmin Mod Community ?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
  7. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    Also what's output of this command (wrap in CODE tags)

    Code (Text):
    mysqladmin var | egrep "^\| max_allowed_packet|^\| wait_timeout" | tr -s ' '
     
  8. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    No, i dont. Other site use default install with option 22.
    New site use option 22 to setup.

    Code:
    mysqladmin var | grep '^| max_allowed_packet' | tr -s ' '
    | max_allowed_packet | 134217728 |
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    looks okay to me for max_allowed_packet but depends on size of all your mysql databases

    what do you get when you manually run these commands for wp-cli
    Code (Text):
    cd /home/nginx/domains/mysite.com/public
    /usr/bin/wp --info --allow-root
    /usr/bin/wp plugin status --allow-root
    /usr/bin/wp db query "show tables;" --allow-root
    


    for last query you can mask the table prefix_ if you want
     
  10. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4

    Code:
    /usr/bin/wp --info --allow-root
    PHP binary:     /usr/local/bin/php
    PHP version:    5.6.24
    php.ini used:   /usr/local/lib/php.ini
    WP-CLI root dir:        phar://wp-cli.phar
    WP-CLI packages dir:
    WP-CLI global config:
    WP-CLI project config:
    WP-CLI version: 0.24.1
    
    Code:
    /usr/bin/wp plugin status --allow-root
    8 installed plugins:
      I akismet                         3.1.11
      I cache-enabler                   1.1.0
      A cdn-enabler                     1.0.3
      A disable-xml-rpc                 1.0.1
      I optimus                         1.4.6
      A sucuri-scanner                  1.8.1
      A wp-super-cache                  1.4.8
      A wp-super-cache-clear-cache-menu 1.4
    
    Legend: I = Inactive, A = Active
    
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
  12. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    have you tried updating to php 5.6.25 ?
     
  13. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    No, let me update php to 5.6.25.

    I will let you know result after update.

    Thanks.
     
  14. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    After update PHP to 5.6.25. Option 22 work like charm.

    Thank spending time to help me.

    How to check cronjob to remove old entry data ( mysite.com - added with option 22 but remove manually)

    Thanks.
     
    • Like Like x 1
  15. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    ah so could of been php bug !

    to list cronjobs and then invoke the nano text editor to edit the cronjobs.. exiting nano will save and update your cronjobs
    Code (Text):
    crontab -l
    crontab -e

    also there's a wp uninstall script generated in output of centmin.sh menu option 22 which should remove stuff too

    from Wordpress Nginx Auto Installer (WP Super Cache)

    Code (Text):
    ------------------------------------------------------------
    Created uninstall script
    /root/tools/wp_uninstall_newdomain2.com.sh
    ------------------------------------------------------------

    where newdomain2.com is site domain name

    running the script should remove all newdomain2.com related files including the cronjob and vhost config files except the database itself which you can do manually

    you can check the contents of /root/tools/wp_uninstall_newdomain2.com.sh to see what gets removed to confirm
     
  16. YuchiRO

    YuchiRO Member

    93
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:18 AM
    5.5.4
    I adding second new mynewsitedomain and stuck at

    Updated user id ...xxx from my previous message untill now :(
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    try editing /etc/my.cnf values to the following for these 2 items and restarting mysql server
    Code (Text):
    max_allowed_packet = 256M
    wait_timeout = 3600
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    if it's still slow, you can re-run centmin.sh menu option 22 on new test domain, but before you do run open a 2nd ssh window connection to your server and double check what mysql processlist is listing via these commands

    create directory, /home/mysqlproclist change into it and create file named mysqlproc.txt then run mysqladmin processlist command in a loop every 1s interval and save output to mysqlproc.txt file
    Code (Text):
    mkdir -p /home/mysqlproclist
    cd /home/mysqlproclist
    touch mysqlproc.txt
    mysqladmin proc -i1 >> mysqlproc.txt

    this will hang the last command while it saves mysql processlist every 1s interval to mysqlproc.txt file

    then in the other ssh window run centmin.sh menu option 22 to completion.

    then in mysqladmin ssh window hit CTRL+C to end that command

    grab the contents of mysqlproc.txt and post contents of log to pastebin.com or gist.github.com (santised for db name(s) and username(s) as it lists all mysql queries being run for ALL databases on your server.
     
  19. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    5:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    From your provided mysqlproc.txt and server load issues at the time, sounds like mysql query /load issues with your other wordpress and web app mysql using scripts at the same time. Centmin Mod is provided as is so optimisation of software related to web app usage is left to the end user.

    Centmin Mod is provided as is, so troubleshooting load issues is left to end user to do. However, there's many linux tools and scripts that can help you figure out what was causing the load issues and when.

    If you're providing info on this forum, more info might be helpful
    1. What version of Centmin Mod ? .08 stable or .09 beta ? If .09 beta when was it installed and when was last time you updated ?
    2. What's your VPS/Server hardware specifications ? cpu type ? memory available ? disk space ?
    3. Who's your web host ? Different hosts have different limits for server resource usage and some are more restrictive that others so it could just be their resource usage policy you tripped which may or may not be restrictive. If restrictive, then real solution would be finding a better web host. If not restrictive, then it's finding out what caused high cpu load.
    Tools and commands you will want to read up on and learn for basic system admin tasks and troubleshooting.
    Notes: