1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Blog Is Very Slow Because Of Slow Mysql Queries

Discussion in 'Blogging' started by nenjak, Dec 10, 2010.

  1. nenjak

    nenjak Junior Member

    Joined:
    Mar 29, 2010
    Messages:
    111
    Likes Received:
    38
    Gender:
    Male
    Occupation:
    This
    Location:
    Portland Oregon
    Can someone help me with an issue I am having with one of my blogs? Ive searched every where on this site but can find it posted anywhere.

    So I got a dedicated server because one of my sites was blowing up. It gets between 3-5k visits a day currently and almost has 32k posts. The dedi is from Siteground and is Atom Dual-Core 330 1.6 GHz.

    I use wp-supercache with compression. I literally turned off wp-robot but for some reason the site is still very slow and even slower in the admin area. Especially when it comes to editing or posting a new post, usually it just times out. The whole site will time out where Digg cant even find the url.

    Does anyone have any ideas on how I can better optimize the site?

    How can you tell if your site has been a victim of a DDOS attack?

    Any help would be greatly appreciated.:fingersx:
     
  2. dannyhw

    dannyhw Senior Member

    Joined:
    Jul 16, 2008
    Messages:
    980
    Likes Received:
    462
    Occupation:
    Software Engineer
    Location:
    New York City Burbs
    Talk to your host and see if they can help you. 3,500 visitors isn't nearly enough to even consider a dedicated server and wprobot is hard on cpu when it's running but not on mysql. If your host is worth anything they'd detect a DDOS and if it was a HTTP based DDOS it'd be in your logs.

    It really sounds like something is just seriously wrong with the way they have MySQL set up and it's their responsibility to fix. Did you switch to dedicated because of performance problems or did you just want to get ahead of the game? If there were performance issues with that small amount of traffic on any virtual hosting there was some serious issues there too.
     
  3. enSo

    enSo Regular Member

    Joined:
    Jul 15, 2009
    Messages:
    250
    Likes Received:
    301
    Occupation:
    Take a Guess
    Location:
    try to repair and optimize the database from cpanel. It goes a long way. Also, if you're using statpress you might want to disable it. It's known to slow down the site.
    You can also try css and javascript compressor plugins. WP-CSS is one that worked wonders for me.
    Try restarting the server too. Maybe you've got a bunch of scripts running in the background that are taking up all the resources.
    The problem may also be from the host. Maybe you've got a package with a low uplink port speed...
     
  4. JohnStro

    JohnStro Newbie

    Joined:
    Dec 12, 2010
    Messages:
    18
    Likes Received:
    0
    Nice work getting those numbers, man
     
  5. avalanch

    avalanch Newbie

    Joined:
    Apr 16, 2008
    Messages:
    41
    Likes Received:
    12
    Home Page:
    There are only 2 plugins I use to speed up my wordpress

    DB Cache Reloaded
    PHP Speedy

    Adding this to your .htaccess helps alot to.

    Code:
    FileETag MTime Size
    <ifmodule mod_expires.c>
    <filesmatch "\.(jpg|gif|png|css|js)$">
    ExpiresActive on
    ExpiresDefault "access plus 1 year"
    </filesmatch>
    </ifmodule>
    
    
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html
     
    • Thanks Thanks x 1
  6. blackcatgill

    blackcatgill Registered Member

    Joined:
    Dec 15, 2010
    Messages:
    86
    Likes Received:
    5
    ive got exactly the same problem , my host has told me to run a slow sql quiery log.How do i do that tiriinx ? ive gone into phpmyadmin etc , got the database ive got a problem with , clicked on sql , i then get a box where i have to type something in , does anyone know what i have to type in to get a slow quiery log ?

    thanks guys
     
  7. flymethod

    flymethod Regular Member

    Joined:
    Oct 27, 2010
    Messages:
    214
    Likes Received:
    58
    can u run the query:

    EXPLAIN
    SELECT `ID`, `post_author`, `post_date`, `post_date_gmt`, `post_status`, `post_name`, `post_modified`, `post_modified_gmt`, `post_parent`, `post_type` FROM `wp_posts` WHERE ( (post_status = 'publish' AND (post_type = 'post' OR post_type = '')) OR (post_status = 'publish' AND post_type = 'page') ) AND post_password='' ORDER BY post_modified DESC

    maybe it is improperly using indexes or none at all? not sure...
     
  8. nenjak

    nenjak Junior Member

    Joined:
    Mar 29, 2010
    Messages:
    111
    Likes Received:
    38
    Gender:
    Male
    Occupation:
    This
    Location:
    Portland Oregon
  9. nenjak

    nenjak Junior Member

    Joined:
    Mar 29, 2010
    Messages:
    111
    Likes Received:
    38
    Gender:
    Male
    Occupation:
    This
    Location:
    Portland Oregon
    I switched because of performance issues.
     
  10. LottyDotty

    LottyDotty Newbie

    Joined:
    Jan 11, 2011
    Messages:
    25
    Likes Received:
    11
    Sounds like an Indexing problem or a bad host
     
  11. nenjak

    nenjak Junior Member

    Joined:
    Mar 29, 2010
    Messages:
    111
    Likes Received:
    38
    Gender:
    Male
    Occupation:
    This
    Location:
    Portland Oregon
    Thanks, this seems to have helped.:cool:

    Will report for other sites.