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.

Issues Not Fixed : Overload and sites too slow

Discussion in 'Workarounds and Optimization' started by houssem-hj, Feb 19, 2012.

  1. houssem-hj

    houssem-hj Member

    Joined:
    Feb 19, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello.

    I have a deticated server with this configuration :

    Processor : Dual-Core E2160
    Ram : 4GB DDR2
    Hard Disk : 2x500GB SATA2
    Uplink Port : 1 x 100Mbps Full-Duplex
    Bandwidth : 5000 GB (Standard network)

    And i use VHM Accelerated 2 (for root), and Cpanel Accelerated 2 as user for my websites.

    Configurations :
    Easy Apache v3.9.2
    Apache 2.2
    PHP 5.2.17


    I'm a little bit a newbee with VHM and linux, because i always use only Cpanel.

    I opened 3 packages for 3 websites, the first days the websites works fine but now i still receive these emails :
    ---------------------------------------------------------------
    While processing the log files for user xxxxxxx, the cpu has been
    maxed out for more than a 6 hour period. The current load/uptime line on the server at the time of
    this email is
    04:33:13 up 11 days, 6:00, 1 user, load average: 47.60, 43.69, 41.14
    You should check the server to see why the load is so high and take
    steps to lower the load. If you want stats to continue to run even with a high load; Edit
    /var/cpanel/cpanel.config and change extracpus to a number larger then 0 (run
    /usr/local/cpanel/startup afterwards to pickup the changes).
    --------------------------------------------------------------
    I changed extracpus value to 2 and i always receive this email for my 3 accounts (3 users).

    and now every website take more than 10 seconds to load (any page).

    And even for the VHM panel or Cpanel it takes too long to load.

    One of my websites have more than 15 k of visitors/day and about more than 200 visitors connected at the same time (forum).

    The other have about 1.800,000 indexed pages by google and i use 5 databases for this website, but there is no big number of visitors that connect at the same time.

    The third website is the newer and become very slow.


    I think that having a dedicated server will resolve my problems,

    i alwas had a (500 server eroor) for my first website when it's hosted on shared hosting.

    And i always had a suspended database by my old provider for my second website (overload that affects the others clients).

    Did i miss something ??
    I did not change the main configration with my VHM.

    Must I reduce or increase some values ??

    I really need help, I'm loosing visitors every day.
    So please, help me to resolve this issue.
    Any suggestion will help.

    Thank you all.
    Best Regards.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please check WHM > Daily Process logs to see what shows up there for potential issues or high using sites. Also, log into the machine in root SSH and run the "top" command without the quotes to see what processes are running.
     
  3. houssem-hj

    houssem-hj Member

    Joined:
    Feb 19, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Tristan.

    Thank you for your answer.

    I forgot to say that i'm using :
    WHM 11.30.6 (build 3)
    CENTOS 5.7 x86_64 standard on server

    And even when i connect to my VHM panel (https:// my Ip :2087) the login window appears quickly, but the connexion is too low.

    Here is the results :

    Daily process logs :

    Top command :
    I see that mysql is taking 81% of the cpu by the Daily Processing log, and 142% of the cpu with the top command.

    How to fix this problem ?

    Waiting for an answer.
    Thank you so much for your help.
     
  4. eperdeme

    eperdeme Well-Known Member

    Joined:
    Oct 15, 2003
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Manchester, UK
    cPanel Access Level:
    DataCenter Provider
    I would advise you invest in some form of Linux administrator with some coding ability to get you out of this problem.

    PHP processes really should not be around for more than a few seconds for general customer site visits, if they are either the website is coded incorrectly or the server can not process the request in a timely manner.

    For SQL to be so high I would expect you to be thrashing the database hard which can not return the lookups quick enough which explains the hanging around PHP sessions. You need to optimise the code that is access the database by selecting less data, or doing less joins. If you need to do a lot of joins look at a RAM disk for the MySQL TMP folder.

    With only 2x500GB SATA drives which I expect to be in a mirror RAID your IOPS is going to be low which is not good for the database.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The site that appears to be using the most MySQL activity is this one:

    It shows 57.9 processes average for MySQL, which is pretty high. You would want to check into adding logging and looking into optimizing MySQL. You are likely going to have to get a DBA for any additional improvements after MySQL optimization has been done with basic tools.

    There's a presentation done on MySQL optimization at the 2010 conference:

    MySQL Optimization | cPanel Video Site

    One tool you can run would be /usr/local/cpanel/3rdparty/mysqltuner/mysqltuner.pl to see what variables you might adjust in your /etc/my.cnf (MySQL configuration) file.
     
  6. houssem-hj

    houssem-hj Member

    Joined:
    Feb 19, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you eperdeme for your help.

    I'm trying to review the php code to optimize the mysql connexions.

    About the hard Disk : is 2x500 GB = 1000 GB is not enough ?

    The largest size that my database has reached is 500 MB = 0.5 GB is this too high ?

    If i miss something, Please let me know more !!

    Thank you again Tristan.

    I'm viewing the php code of the website3, theres some connexions that are not closed so i added the commands mysql_free_result() and mysql_close() and i will see.

    Here are the results of /usr/local/cpanel/3rdparty/mysqltuner/mysqltuner.pl :

    I edited /etc/my.cnf and add these lines :
    Is this right ?
    And should i restart mysql service or the server ?


    Thank you in adavance.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You would want to change table_cache to table_open_cache due to using MySQL 5.1 on the machine. The variable name changed for MySQL 5.1

    Also, you do need to restart MySQL on the machine after updating the variables.
     
  8. houssem-hj

    houssem-hj Member

    Joined:
    Feb 19, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you Tristan.

    Here is my new etc/my.cnf

    I restarted MySQL.

    Please tell me if i should add something else in my etc/my.cnf

    I will let you know about the results.

    Thank you so much.
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You may want to change these lines to make them compatible with the current MySQL you are using:

    Code:
    [mysqld]
    max_connections=500
    slow_query_log
    query_cache_size = 8M
    thread_cache_size = 4
    table_open_cache = 80
    set-variable is deprecated, so I removed it. safe-show-database is a default setting and not necessary. log-slow-queries is used for MySQL 5.0, while MySQL 5.1 uses slow_query_log instead. This will place slow query logging into /var/lib/mysql location with a file called hostname-slow.log where hostname is the short hostname name of the machine.
     
  10. houssem-hj

    houssem-hj Member

    Joined:
    Feb 19, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you Tristan.

    I did these changes, i restarted MySQL..

    I did reboot server too..

    I don't know why, the server is down all yesterday and today, no one of my websites is accessible !!

    When i try to login via VHM here what i get :
    What do you suggest ??

    I'm thinking to change my hosting provider, is this a good idea ?
    or This is my fault and i did a wrong configuration or wrong php coding ?

    Here are my real problems When i use a shared hosting :
    - My 1st website send always a 500 server error, and this error is only when more than 100 users are connecting on the same time.
    - My 2nd website have always a database problem, (the hosting provider allow only 100MB / database), but it works.
    - My 3rd website is a little bit slow, but it works.

    I'm spending about $100 / month for my server+Cpanel licence, and i found this not enough.
    I'm thinking to take differents VPS from differents providers, this will cost lower, is this a good solution ??

    I'm really sorry to ask again, but i'm really needing help.
    Please advice me.
    Thank you in advance.
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    The issue in WHM is cPHulk Brute Force Protection in regards to being unable to log into the machine. Do you have your IP whitelisted in cPHulk Brute Force Protection in WHM so you do not get locked out? Please add your IP there if you have not done so.

    As for the server being down and no websites being accessible, were you able to connect to the machine at all in root SSH or otherwise? I don't know if you might have a firewall blocking ports or it is cPHulk Brute Force Protection or it might be a denial of service (which would explain high level brute force attempts also locking you out).

    As for the costs, if you find that you would prefer a VPS to test it out over a dedicated machine, that's certainly up to you. I wouldn't be able to provide recommendations for that personally.

    Thanks!
     
Loading...

Share This Page