The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Performance Manger Plugin (NEW)

Discussion in 'Workarounds and Optimization' started by WhiteDog, Nov 28, 2013.

  1. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Dear Community,

    I am currently working on a new and free cPanel Plugin. To goal is to incorporate a number of cleanup and optimization tasks that can enhance the performance of your server. Most of these actions are to be run for all users on the server.

    I currently have the following actions implemented / planned:

    Remove Logaholic History
    Action: Checks if the server and/or user has Logaholic on. If not, it will remove the folder in /var/cpanel/userhomes/cpanellogaholic/ (cPanel 11.40+)
    Reason: Each entry in /var/cpanel/userhomes/cpanellogaholic/ contains thousands of files. These files are also backed up, can grow huge and take a long time to process. On one server I removed 100 000+ files, saved a few GB and reduced server backup time by 45 mins.

    .htaccess ErrorDocument fixing
    Action: searches .htaccess for ErrorDocument <Number> http://something entries and removes them.
    Reason: these entries cause errors in the Apache log

    Deactivate WordPress cron
    Action: Searches for wp-config.php and checks if "DISABLE_WP_CRON" is in there. If not, it inserts the line and configures a cron to run once a day t a random time.
    Reason: WordPress cron can cause high sever load

    error_log cleaning
    Action: Searches for error_log files and removes them.
    Reason: error_log files can become very large over time

    I'm planning to release a first beta version soon. If you would like to try it out already feel free to send me a DM.

    I am however looking for more "performance tasks" to implement. If there are any scripts, commands or actions that you regularly run on your servers, please let me know. I will then try to implement them in one easy plugin for all to use.

    For those wondering: yes, my customers were / are informed of these actions before I ran them.
     
    #1 WhiteDog, Nov 28, 2013
    Last edited: Nov 28, 2013
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    This is a bad idea, it defeats the point in having error logs. Now what would be good is if you could get an email warning when the error log reaches > size.

    Optimise all databases:
    Code:
    mysqlcheck -o -A
     
  3. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    I agree. I have 2 types of users: those who develop their own software and those who just run Drupal / Joomla / ... via Softaculous. The latter is the largest userbase and have no interest in error_log files. So for now I decided to just periodically remove these files. Another option could be to trim these files by line count and/or entry timestamp. So you could set e.g. keep 1000 lines + remove lines older than 30 days.

    That was on my mind as well. However I've seen better versions of the above where you skip innodb tables etc. There is another thread on the forums where I got this snippet from:

    Code:
    for database in `find /var/lib/mysql/ -type d|awk '{print $2}' FS="/var/lib/mysql/"`; do 
    mysql $database -e "show tables" | grep -v Tables_in | grep -v "+" | gawk '{print "optimize table " $database ";"}' | mysql $database; done
    I'll try to contact the author to get the "improved" version (see her last reply) :)
     
  4. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    InnoDB is far better! While cpanels latest available version is Mysql 5.5.32 with MYISAM as the default storage engine, when it upgrades to version 5.5.5 this will change. The default engine will be InnoDB . MySQL :: MySQL 5.5 Reference Manual :: 14.1 Setting the Storage Engine
     
    #4 kernow, Nov 28, 2013
    Last edited: Nov 28, 2013
  5. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Hi kernow,

    My comment was only about optimizing mysql tables. From what I understood in the other topic innodb tables don't need to be "optimized". However running the optimize command on innodb table rebuilds them or something. So I wolud prefer to only optimize tables that actually need it :)
     
  6. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    I just completed a first version. You can find the installation instructions here: Performance Manager - How2 Solutions

    Some important notes on this first beta version:
    1. If you receive an error related to AppConfig (see Tweak Settings), disable it for a moment. The plugin will upgrade itself to be compatible with AppConfig on first run. You can then re-enable AppConfig.
    2. NO changes are made. Only a Dry Run is performed no matter what options you select. So you will only receive a long list of things that could potentially be optimized for now.

    Please note that this is still a huge work in progress. But please keep sharing your feedback and suggestions for things to add.
     
  7. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    I have updated the first beta. You can now run some actions. I also included the ability to remove orphan files and folders (core dumps, cpmove folders, ...) and to check the cron jobs of a user (number of jobs, jobs configured to run every minute).

    Feel free to try the plugin and provide some feedback :)
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,450
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Whitedog, please feel free to submit this to the cPanel AppCat:
    cPanel App Catalog

    You might also want to setup some sort of support system, on your own website, to manage issues with your users.
     
  9. WhiteDog

    WhiteDog Well-Known Member

    Joined:
    Feb 19, 2008
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    I'm aware, but I wanted to get a more working version out before I submitted it.

    People can use the ticket system on our website to report bugs, ask questions or request features.

    In other news, I pushed a new version of the plugin that also optimizes MySQL tables. Only MyISAM tables are optimized so no wasted cpu cycles there. Also because mysql tasks are per account, they are more spread out instead of hammering mysql for a long time at once.

    On the todo list:
    - Pause processing when server load is above set value (to avoid issues when running at the same time as e.g. cplogrotate).
    - Finish the advertised features
    - Make the cron job do something
    - Save your selected settings

    I'm fresh out of ideas for additional optimizations though... so please bring some :)
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,450
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:

    Advertising on this forum is not permitted, even for free cPanel plugins. Support should not be on these forums either.

    Moved to Workarounds, for now.
     
  11. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    How about checking to see if there are any "old" backups that belonged to terminated accounts? ie: If there is a backup folder belonging to a user that no longer exists (since terminated) and is xyz days old, then delete it.
     
  12. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
    Was this app ever added to the cPanel App Catalog? I see a link on your site that says it was, but get a 404 when clicking the link.
     
Loading...

Share This Page