Blog too slow. Any suggestions?

Discussion in 'WordPress' started by mordimi, Feb 19, 2011.

  1. #1
    Hello guys, first of all sorry for my english.

    i have a two wordpress blogs hosted on Hostmonster (shared server), one runs fast and the other one it's way too slow (you can check it, the blog on my signature).
    i've checked the possible causes, I have widget cache plugin, W3 total cache plugin, so all JS are in the bottom, css minified etc etc.
    I repaired the DB table, optimized, deleted all the unecessary plugins, tried also disabling all plugins, but the result is the same more or less, it tooks about 15seconds to load it all.
    My blog is "big", with more than 1400 posts so i think the problem is the database.

    Any suggestion? (or should i really upgrde to a dedicated server?)
     
    mordimi, Feb 19, 2011 IP
  2. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    update:in the error log in the cpanel i see this error everysecond

    RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.
     
    mordimi, Feb 19, 2011 IP
  3. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What is your permalink structure settings? It appears to be /%postname%/%postID%/ which is backwards. Testing has proven that not having the numeric (indexable) value in the front of the permalink will add several rewrite rules for each post. This is just one problem that may be slowing your down.
     
    Dodger, Feb 19, 2011 IP
  4. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    yes it's postname/id and i added the id in the permalink cause i made an iPhone APP and i needed an ID for each post showed in order to parse properly on the app.
    I'll try removing temporary the id from the url and i'll see if it's better
    (thanks for the suggestion)

    update: i have the same structure also on the other blog that runs fine
     
    mordimi, Feb 19, 2011 IP
  5. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    nothing, always slow (and alternate itnernal error 500) and always this error 3-4times per second
    [warn] RewriteCond: NoCase option for non-regex pattern '-f' is not supported and will be ignored.
     
    mordimi, Feb 19, 2011 IP
  6. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You will want to move the ID to the front. That is the value that gets indexed, and a rewrite rule will not be needed.

    Does your other blog have as many posts as the problem blog? If it has just as many or more, then the problem does not lie in the permalink structure (but it will sooner or later)
     
    Dodger, Feb 19, 2011 IP
  7. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    So you would suggest to put /$post_id%/%postname%/ ? I tried removing post_id for now, but it's still slow and that error cames up

    yes, the other blog has the same permalinks structure but about 200 posts

    I'm checking now the .htaccess and i think it's REALLLY screwed up (DAMN)

    there was about 150 lines maybe added by some cache plugin and most of the rewritecond were repeated many times, now i only have
    AddHandler fcgid-script .php
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
     RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
     RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/Meletta-HitTheSpot [R=302,NC,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    HTML:
    update: blog is the same, errors too

    update2: there are also a lot of error like
    Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
    HTML:
    and googling seems it's a bug of PHP
     
    Last edited: Feb 19, 2011
    mordimi, Feb 19, 2011 IP
  8. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The rewrites get written to the database and do not show up in .htaccess. WP will go through every rewrite when a Url is called. If you have a couple of thousand posts, multiply that by about 5, and that is how many rewrites that need to get processed before anything else happens. Now multiply that by how many visitors are accessing your site at the same time -- and it becomes real obvious that there is a severe DB and processing hit going on before any real page is opened.

    As mentioned, this may only be part of the problem you are having. If it is not a problem now, it only gets slower and slower with each additional post. Your other blog only has a couple of hundred right now, and is not really degraded enough to show.
     
    Dodger, Feb 19, 2011 IP
  9. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #9
    Ok, it's clear. but how can i resolve? manually deleting every query on the db?
     
    mordimi, Feb 19, 2011 IP
  10. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #10
    When you "save" the new permalink structure, those rules get rewritten to apply. No need to delete. If you use the Post ID (or date values), then WP only needs one rule since it is a simple numeric value. Text values up front need separate rules for each. This is just the way WP handles permalinks.
     
    Dodger, Feb 19, 2011 IP
  11. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #11
    yes i understood that, but it's not the reason why my site is slow. i guess. i tried to edit the permalink but nothing is changed.
    when i click on a link there are 4-5 seconds of FREEZE..then it start loading (slowly)
     
    mordimi, Feb 19, 2011 IP
  12. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I just checked your site (from sig line) and you have just the postname permalink. One thing you can try, and permalinks are funny things, is to use flush_rules() at the top of your functions.php file once. This will do a rewrite of all the rules based on your permalink structure. Leave that code in until you get the rules you want, then take it back out.

    As for page loading, there is something hanging it up. I get the header, nav, post title, then it freezes. Looking at the Html (all I can see on my end) is there is a plugin for the AppStore. An image is supposed to be there, but the site freezes at this point. Try disabling that plugin and see what happens.
     
    Dodger, Feb 19, 2011 IP
  13. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Another thing I noticed is you are using NextGen Gallery AND HighSlide. Both scripts are loading and I think one may want to be boss here and may be a conflict going on. You may want to stick with one or the other. Actually, I use ShadowBox-JS myself and all of that code loads in the footer.
     
    Dodger, Feb 19, 2011 IP
  14. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #14
    it happens only now after i played with htaccess rules, it stucks loading in the appstore plugin...damn...im going to add your plugin for the images and remove both next and highslide
     
    mordimi, Feb 19, 2011 IP
  15. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #15
    If I remember right, ShadowBox-JS has a "smart loading" option also which works most of the time. There are no special control boxes to fill in, and it works with the standard "gallery" shortcode for images, and do not remember how it works on videos. But it is mostly automatic and pretty kewl!

    Don't mess with those .htaccess rules too much. They are auto-generated, and you may end up screwing the pooch. If something bad happens, just delete the file and let it get auto-generated again.
     
    Dodger, Feb 19, 2011 IP
  16. mordimi

    mordimi Active Member

    Messages:
    177
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #16
    yes i did it, and now the plugin loads well, i also deleted highslide and installed shadowboxjs, even if i loved highslide :(
     
    mordimi, Feb 19, 2011 IP
  17. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I used HighSlide for a couple of years. Even bought a license for it. :)

    Yep, it is a hard one to give up. But there are always new things coming down the road with jQuery.
     
    Dodger, Feb 19, 2011 IP
  18. marht

    marht Active Member

    Messages:
    142
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    58
    #18
    There's a plugin called Super Cache. It will make your site load faster ;)!
     
    marht, Feb 20, 2011 IP
  19. redwolf6

    redwolf6 Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Use CDN

    Move to litespeed hosting.
     
    redwolf6, Feb 20, 2011 IP
  20. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Learn to read. He is using a cache plugin, and his site is not loading faster. You need to type less faster before you read slower ya ya?
     
    Dodger, Feb 20, 2011 IP