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.

MySQL & Server optimization

Discussion in 'Workarounds and Optimization' started by greatchap, Sep 30, 2010.

  1. greatchap

    greatchap Registered

    Joined:
    Sep 30, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello Guys,

    I am attempting to host a small business website. I have acquired webspace from hostgator.com and its VPS (virtual private server). The reason I got VPS was because I have programs which connect to mysql server from time to time. So I thought a shared server wouldn't be able to handle the load.

    Anyways, I have setup a few mysql databases. Right now I have a program which is used by few ppl (< 4) at my place. This application connects to mysql server at startup and if you invoke a method.

    The problem I am facing is connection failure usually with a message "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond".

    This is strange and it connects after a few attempts. Moreover its escalated a bit today, before it was not that bad. Right now its only used by a handful of people, but if I give it to hundreds of people then what ??.

    What mysql settings can I change which would help me out ? And why is this happening?

    The program is made in vb.net and uses mysql connector.

    Moreover there is another small program which uploads small (around 20KB) files to the server at regular intervals. And at time the upload also fails.

    Is my server settings not optimized or what should I do to solve those 2 problems ?

    Help will be appreciated.

    Thanks,
    GR
     
  2. GaryT

    GaryT Well-Known Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    3
    Trophy Points:
    16
    A connection attempt failed because the connected party did not properly respond after a period of time,

    I'm confused here are you using MySql cluster ?

    First of you should post your system stats, what you have, memory and such..

    Then also post your MySql configuration, Copy/Paste here the output of your my.cnf

    SSH

     
  3. greatchap

    greatchap Registered

    Joined:
    Sep 30, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    query

    How do I do that ?
     
  4. GaryT

    GaryT Well-Known Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    3
    Trophy Points:
    16
    You do it in SSH - Secure shell access to the root of the machine.

    For an SSH client use Putty, Its free and easy to use, Downlaod from here:

    PuTTY: a free telnet/ssh client
     
  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
    To get the contents of /etc/my.cnf, the command should be to cat the file rather than open it (no need to open a file unless you intend to edit it). This is how to get the contents in root SSH:

    Code:
    cat /etc/my.cnf
    Also, you probably want to see the MySQL error logs to see if there's anything in them that might tell you what's going on:

    Code:
    cd /var/lib/mysql
    tail -f hostnamer.err
    Replace hostname.err with the server's fully qualified hostname. If you cannot find the .err file for the error log, try to figure out the name by doing:

    Code:
    cd /var/lib/mysql
    ls -lah *.err
    You should then see the file's name to figure out what it's called.

    The best way to see if MySQL is producing errors for the script is to tail the error log (tail -f) while reproducing the error. Once you get the error on the site, then see what the MySQL error log shows. If you don't see any errors in the MySQL log, it isn't MySQL that's the issue but either a) PHP, b) Apache.
     
Loading...

Share This Page