Fork me on GitHub

unoptimized SQL queries. We need help ASAP  Bottom

  • icon_confused We have been running a Post nuke site for several years. We did two upgrades in the past 2 years, the last one being last July to now running 0.7.6.4 The upgrades were done by a very senior member found here at PostNuke, unfortunately he is no longer available. Everytime we did an upgrade we lost some features...

    Anyway currently we have a big problem with our site, which will die if I don't get help ASAP from one of you seasoned experts. Our site got attacked a few times..now we just get the below message from our Host. What we need is a good physical IT emergency examination to determine why our Post Nuke site seems prone to attacks. Please help.

    Thanks Immensily. My private e-mail is paularen@gmail.com
    Paul,

    Here is how our host writes us:

    At the moment, the server is using a lot of CPU in running just a few unoptimized SQL queries.

    The main regular high-CPU query is the following:
    # Time: 080203 1:20:35
    # User@Host: ts_ts[ts_ts] @ localhost []
    # Query_time: 5 Lock_time: 0 Rows_sent: 1 Rows_examined: 531354

    SELECT count(nuke_referer.pn_rid) as c
    FROM nuke_referer
    WHERE nuke_referer.pn_url = 'bookmark';
    # Time: 080203 1:20:41
    # User@Host: ts_ts[ts_ts] @ localhost []
    # Query_time: 5 Lock_time: 0 Rows_sent: 1 Rows_examined: 531356

    SELECT count(nuke_referer.pn_rid) as c
    FROM nuke_referer
    WHERE nuke_referer.pn_url = 'bookmark';
    # Time: 080203 1:20:42
    # User@Host: ts_ts[ts_ts] @ localhost []
    # Query_time: 4 Lock_time: 0 Rows_sent: 1 Rows_examined: 531356

    SELECT count(nuke_referer.pn_rid) as c
    FROM nuke_referer
    WHERE nuke_referer.pn_url = 'bookmark';

    Over 53,000 rows are checked to collect a small non-essential piece of information that is tying up 100% resources for 4 or 5 seconds, many times each minute. These queries from your post nuke site are causing the outgoing email server to fail at regular intervals and this needs to be stopped.

    If I do not see these times reduced in the coming days, I will resolve the matter by simply emptying the table of information - thus speeding up the queries.
    If you have any questions, please get in touch at any time.

    Best regards,
  • Your first attempt at solving this should be to create an index on the rid column of the nuke_referer table. Presumably this would lower the execution time for this query significantly.

    Greetings
    R
  • Thanks allot for that. Could you help us with that? What we really need is to have this done along with a professional evaluation of our site, soonest.
  • Have you seen this thread? It's about speeding up postnuke. It refers to dbase performance.
    This lists the entry Robert is talking about.

    The referer table is used by the Referer module that keeps track of the the http references to your site. Do you really need it? I've switched it off on my site. Go to admin -> Referers -> switch off "referers active" if you want to deactivate it.
    Your referer table will not be queried any more and you can empty it if you want. (I've got an empty referer table and never looked back icon_wink )





    edited by: espaan, Feb 06, 2008 - 10:52 AM

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • I concur...turn off referrer collection - user your webstats and server logs for that.

This list is based on users active over the last 60 minutes.