WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
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.
 
Last edited:

kernow

Well-Known Member
Jul 23, 2004
994
42
178
cPanel Access Level
Root Administrator
Action: Searches for error_log files and removes them.
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.

I am however looking for more "performance tasks" to implement
Optimise all databases:
Code:
mysqlcheck -o -A
 

WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
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.
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.

Optimise all databases:
Code:
mysqlcheck -o -A
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) :)
 

kernow

Well-Known Member
Jul 23, 2004
994
42
178
cPanel Access Level
Root Administrator
Last edited:

WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
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
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 :)
 

WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
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.
 

WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
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 :)
 

WhiteDog

Well-Known Member
Feb 19, 2008
142
6
68
Hello Whitedog, please feel free to submit this to the cPanel AppCat:
cPanel App Catalog
I'm aware, but I wanted to get a more working version out before I submitted it.

You might also want to setup some sort of support system, on your own website, to manage issues with your users.
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 :)
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
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.
...

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.
 

electric

Well-Known Member
Nov 5, 2001
777
8
318
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.
 

MaraBlue

Well-Known Member
May 3, 2005
334
2
168
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.