Slow SQL reads after update

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Slow SQL reads after update

    Our web host 'upgraded' our site to CF 6.1, SQL server 2000, and Windows 2003.

    We had been running CF5, SQLserver 2000, Windows 2000.

    Prior to the upgrade, our site performed flawlessly. Our database querys
    were very fast.

    But since the upgrade, a sql query to read 100 records will take 20 seconds.
    (On the previous server, the same query would take less than .5 seconds).

    The web host has no idea what could be causing the SQL database queries to run
    so slow, but they blame it on Cold Fusion.

    To test the query speed I wrote the following code:

    <cfset tstart2 = getTickCount()>
    <CFQUERY name="searchcontent" datasource="testdb" maxrows='100' dbtype="ODBC"
    blockfactor="100" username="#MGUSER#" password="#MGPASS#">
    SELECT page_number
    FROM content
    </CFQUERY>
    <cfset tend=getTickCount()>
    <Cfset ttotal = tend - tstart2>
    <cfif ttotal GT 0>
    <Cfset ttotal = ttotal / 1000>
    </cfif>
    <cfoutput>Time to read 100 records from Content Table: #ttotal# seconds
    <br></cfoutput>

    The above shows to read 100 records takes 20 seconds. Same test on a
    different server shows the reads to take less than .5 seconds.

    Any idea why the new server would be taking 40 times as long to read the same
    records?

    Thanks for any suggestions you can provide.

    Bill

    bmyers Guest

  2. Similar Questions and Discussions

    1. Really slow starts on RH4 w/ latest update
      So, after this latest update, CF 7 takes about 5 minutes to start on a RedHat 4 server. The culprit seems to be the coldfusion registry, which...
    2. Update data --- Page too slow
      I have been working on a database application, somehow my update page is too slow. I fetch some data from the SQl database into a table, the...
    3. imported tif images--very slow import update when opening file--help!
      Hi all, My problem concerns MX for the mac. All of a sudden, when I go to open a file that has an imported tif file in it, it takes 10 to 20...
    4. Post-update UpdateStage REALLY slow!!
      I just converted a big-old .dir file from Dir8.5 to MX. When I run it (on a new G4 powerbook) it runs REALLY slow. I traced the code and the first...
    5. Why is 'Update Pages' sooooooooo SLOW!!!
      It is 3 months later, I am still having this problem... even 4 pages takes either 4 minutes to update a simple menu, or simply stops responding. I...
  3. #2

    Default Re: Slow SQL reads after update

    Ideally, your webhost has upgraded to ColdFusionMX 6.1 updater 1 and not the
    original 6.1. Many fixes are in the updater. Also what kind of datasource is
    "testdb." Hopefully it is a JDBC connection and not really an ODBC connection
    as your cfquery might lead one to believe. CFMX is a java application and JDBC
    connections are optimal. If your datasource indicates it is an ODBC socket
    CFMX is making a JDBC call to an ODBC client/server, which then makes an ODBC
    connection to your SQL server. JDBC will be much faster.

    Additionally, your host may want to test the latest JDBC drivers Macromedia
    has available at
    [url]http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=42dcb10a[/url]

    If none of this helps, make sure it is not due to a database issue. Test your
    query in an odbc query tool like msquery or sqlcon.

    ksmith Guest

  4. #3

    Default Re: Slow SQL reads after update

    Ken,

    Thank you for your reply.

    The web host control panel shows the version of Cold Fusion as 6.1.0.0.

    Is there any way to tell by the version number if the updater has been
    applied? Or any test I can run to check the updater?

    Regarding the datasource type - the only option provided by the web host
    (intermedia.net) is ODBC. Behind the scenes this may be JDBC, but know one at
    intermedia.net seems to know.)

    Thanks again for your reply,

    Bill

    bmyers Guest

  5. #4

    Default Re: Slow SQL reads after update

    This might be an old 3.1 JDBC driver DNS lookup bug (trying to find the SQL
    Server server).

    Ask them what version of the JDBC drivers they have (macromedia_drivers.jar).
    Open up the .jar with winzip and look at sqlserver.properties.

    They can verify this hang issue with a stack trace. (technote 18339).

    The workaround is (if they use an IP in the datasource) to add an entry to the
    HOSTS file to identify the SQL Server or to upgrade to the latest drivers
    (3.5's are on /support/coldfusion). Ideally, get a stack trace. If you have
    a 20 second hang, it should be easy enough to get a stack trace during the
    hang. Paste it into here or send it to me.

    (2nd possibility doesn't sound like the problem. I'm looking at the example
    you have and see no WHERE clause or I would have suspected the "unicode" switch
    in the datasource (JDBC/SQL Server) ignoring indexes on varchar columns. That
    switch is very important with SQL Server - ie leaving it OFF if your where
    clause has VARCHAR columns)

    Stephen Dupre
    Macromedia QA

    sdupre Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139