Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Running cPanel, Excessive Load, Help Needed
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Running cPanel, Excessive Load, Help Needed

Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran
edited January 2014 in Help

Hi,
I use a 2 GB Ram + 1 GB (vSwap), 100 GB Space, 4 vCPU Cores (E5-2620) OpenVZ VPS for My cPanel Hosting. The Problem is about Server Load. I have identified the problem being with MySQL. Right Now, MySQL is using 44.1% CPU. I have checked my.cnf file and it appears as follows:

[mysqld]
#open_files_limit=30880
innodb_use_native_aio = 0
max_connections = 100
key_buffer = 32M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 4000
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 7000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 8M
query_cache_size = 12M
query_cache_type = 1
tmp_table_size = 16M
max_heap_table_size = 16M
local-infile=0

[mysqld_safe]
open_files_limit = 8192
 
[mysqldump]
quick
max_allowed_packet = 16M
 
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
 
[mysqlhotcopy]
interactive-timeout

I run the Following Plugins for cPanel:

Resource Monitor, WHMSonic, Attracta SEO Tool, ConfigServer Explorer, ConfigServer Mail Manage, ConfigServer ModSecurity Control, ConfigServer Security & Firewall, cPremote, Mod Security, Nginx Admin, Softaculous, CloudFlare etc.

Checking deeper with Resource Monitor, I got that MailMan uses the MySQL most & I often get Mail from LFD Like this:

Time:         Thu Jan  2 17:03:34 2014 +0600
Account:      mailman
Resource:     Process Time
Exceeded:     753889 > 1800 (seconds)
Executable:   /usr/bin/python
Command Line: /usr/local/cpanel/3rdparty/bin/python /usr/local/cpanel/3rdparty/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
PID:          1274 (Parent PID:1261)
Killed:       No

Can Anyone help me out that what can decrease My Load ??

Thanks in Advance. :)

Comments

  • Check your pm :)

  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    Replied, Please Check @INIZ :)

  • Iniz has private cPanel counseling now?

  • jarjar Patron Provider, Top Host, Veteran

    The first key is to find the problem, then you can approach the symptoms. If it's mysql, find out what user and why. May be that you need to focus attention on a site being attacked, perhaps even a need to introduce mod_qos.

    Your friend here is "show processlist;"

  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    @DamComp No, the fact is, My Provider is INIZ. So, Patrick is helping me. ;-) Thanks @INIZ

  • Let us all know what you do to fix it :)

  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    @DeanClinton Of Course, I'll let all know about the solution if it got fixed. Made some changes, now waiting for result.

  • @ehostlab what is your IO Wait? I've seen this when disk IO is congested

  • Here are some quick and free tips for you. :)

    Read this: http://forums.cpanel.net/f34/troubleshooting-high-server-loads-linux-servers-319352.html

    1. Run mysqltuner and make the recommended changes

    https://github.com/major/MySQLTuner-perl

    1A. wait_timeout is way too high. Set it to 30 and restart the mysql.

    1. Apache processes using a lot of memory? Run top from command line or view it via cpanel gui.
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    15733 root 15 0 554m 541m 5752 S 0.0 52.9 851:59.84 httpd
    17790 www 15 0 556m 544m 5408 S 0.0 53.1 0:02.77 httpd
    17616 www 16 0 555m 543m 5440 S 0.0 53.1 0:04.69 httpd

    See Daily process log with cpanel.

    Home »Server Status »Daily Process Log

    2A. Adjust apache setting accordingly. My settings for a 2gig cpanel vps.

    Start Server 5
    Minimum Spare Servers 5
    Maximum Spare servers 10
    Server Limit 256
    Max Clients 150
    Max requester child 10000
    Keep-Alive OFF
    Keep-Alive timeout 5 
    Max keep-alive request 100
    Timeout 300
    1. Set SpamAssassin to only work with one thread. So you can reduce the 'children' setting and reclaim some memory on your server for other apps to run with.

    2. Disable services you are not using

    Cpanel

    Home »Service Configuration »Service Manager

    Uncheck mailman (use other)

    Uncheck named (if not hosting dns)

    Uncheck Spamd (if hosting MX records somewhere else. Or see 3 if you need it)

    1. See for any bad crawler sucking up all of your connections. I hope you have mod_sec installed.

    5A. Try this in your .htaccess or make sure mod_sec is blocking connections without headers or others.

    # Rewrite bad bots to 403 - method 1
    
    RewriteEngine On 
    RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Custo [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^HMView [OR] 
    RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR] 
    RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR] 
    RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^larbin [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Wget [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Widow [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR] 
    RewriteCond %{HTTP_USER_AGENT} ^Zeus 
    RewriteRule ^.* - [F,L]
    
    
    # block robots method 2
    BrowserMatchNoCase AhrefsBot/3.1 bad_bot
    BrowserMatchNoCase Baiduspider/2.0 bad_bot
    Order Deny,Allow
    Deny from env=bad_bot
    
    # end rewrite bad bots
    DirectoryIndex index.html home.php index.php
    
    #
    # Compress content to speed up server
    
      
        SetOutputFilter DEFLATE
      
    
    # BEGIN Expire headers
    
      ExpiresActive On
      # ExpiresDefault "access plus 1 seconds"
      ExpiresByType image/x-icon "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 216000 seconds"
      ExpiresByType application/javascript "access plus 216000 seconds"
      ExpiresByType application/x-javascript "access plus 216000 seconds"
      # ExpiresByType text/html "access plus 600 seconds"
      # ExpiresByType application/xhtml+xml "access plus 600 seconds"
    
    # END Expire headers
     
    # BEGIN Cache-Control Headers
    # 1 WEEK
    
    Header set Cache-Control "max-age=604800, public"
    
    # 1 WEEK
    
    Header set Cache-Control "max-age=604800, public"
    
    # 2 DAYS
    
    Header set Cache-Control "max-age=172800, proxy-revalidate"
    
    # 1 MIN
    
    Header set Cache-Control "max-age=60, private, proxy-revalidate"
    
    # END Cache-Control Headers
     
    # BEGIN Turn ETags Off
    
      Header unset ETag
    
    FileETag None
    # END Turn ETags Off
     
    # BEGIN Remove Last-Modified Header
    
      Header unset Last-Modified
    
    # END Remove Last-Modified Header
    
    
    
    order allow,deny
    allow from all
    
    
    deny from xx.xx.xx.xx
    
    
Sign In or Register to comment.