Professional Web Applications Themes

Slow queries when using myODBC with ASP pages - MySQL

Hi, I have a website hosted on two servers bi-xeon(Win2003, 1GB RAM) : one for the website, one for MySQL 4. I access MySQL from my ASP Pages with myOBDC. I noticed a strange problem : When I execute a quite complex query using MySQL control center directly on the MySQL server, I have the following execution times : - With ODBC turned off (ie the website is stopped, so I have no connections from the website to MySQL) : 0.1 sec - With MyODBC on (15 connections simultaneously) : 1,5sec Do you have any idea of where the problem ...

  1. #1

    Default Slow queries when using myODBC with ASP pages

    Hi,

    I have a website hosted on two servers bi-xeon(Win2003, 1GB RAM) : one
    for the website, one for MySQL 4.

    I access MySQL from my ASP Pages with myOBDC.

    I noticed a strange problem :
    When I execute a quite complex query using MySQL control center directly
    on the MySQL server, I have the following execution times :

    - With ODBC turned off (ie the website is stopped, so I have no
    connections from the website to MySQL) : 0.1 sec
    - With MyODBC on (15 connections simultaneously) : 1,5sec

    Do you have any idea of where the problem can come from and how I can
    solve it ?

    Thanks for your help,

    Fred
    Fred Guest

  2. #2

    Default Re: Slow queries when using myODBC with ASP pages

    Fred wrote:
    > Hi,
    >
    > I have a website hosted on two servers bi-xeon(Win2003, 1GB RAM) : one
    > for the website, one for MySQL 4.
    >
    > I access MySQL from my ASP Pages with myOBDC.
    >
    > I noticed a strange problem :
    > When I execute a quite complex query using MySQL control center directly
    > on the MySQL server, I have the following execution times :
    >
    > - With ODBC turned off (ie the website is stopped, so I have no
    > connections from the website to MySQL) : 0.1 sec
    > - With MyODBC on (15 connections simultaneously) : 1,5sec
    >
    > Do you have any idea of where the problem can come from and how I can
    > solve it ?
    >
    > Thanks for your help,
    >
    > Fred
    MySQL Control Center uses direct connections (i.e. through calls to
    MySQL C API library) while MyODBC has a few additional layers on top
    of taht. Thus, connections through ODBC are always slower than direct
    connections.

    Instead of MyODBC, you may try Connector/.NET, which does not have any
    intermediate libraries to slow down the data flow.
    [url]http://dev.mysql.com/doc/refman/5.0/en/connector-net.html[/url]

    Some tutorials here:
    [url]http://www.vbmysql.com/articles[/url]

    ciao
    gmax

    --
    _ _ _ _
    (_|| | |(_|>< The Data Charmer
    _|
    [url]http://datacharmer.blogspot.com/[/url]
    Giuseppe Maxia Guest

  3. #3

    Default Re: Slow queries when using myODBC with ASP pages

    Giuseppe Maxia a écrit :
    >
    > MySQL Control Center uses direct connections (i.e. through calls to
    > MySQL C API library) while MyODBC has a few additional layers on top
    > of taht. Thus, connections through ODBC are always slower than direct
    > connections.
    Thanks for your answer.

    In fact, the execution times was both measured executing the query in
    MySQL CC, the difference is just that in one case, Mysql was also
    sharing connections with MyOBDC.
    >
    > Instead of MyODBC, you may try Connector/.NET,
    My website is developped in ASP, not in ASP.NET.
    Can it work (ASP.NET works on my web server) ?
    Fred Guest

  4. #4

    Default Re: Slow queries when using myODBC with ASP pages

    Fred wrote:
    > Giuseppe Maxia a écrit :
    >
    >>
    >> MySQL Control Center uses direct connections (i.e. through calls to
    >> MySQL C API library) while MyODBC has a few additional layers on top
    >> of taht. Thus, connections through ODBC are always slower than direct
    >> connections.
    >
    > Thanks for your answer.
    >
    > In fact, the execution times was both measured executing the query in
    > MySQL CC, the difference is just that in one case, Mysql was also
    > sharing connections with MyOBDC.
    >
    >>
    >> Instead of MyODBC, you may try Connector/.NET,
    >
    > My website is developped in ASP, not in ASP.NET.
    > Can it work (ASP.NET works on my web server) ?
    I am not very much knowledgeable on ASP programming.
    You should check the docs I already mentioned, or browse the archives in the relevant forum:
    [url]http://forums.mysql.com/list.php?38[/url]

    ciao
    gmax

    --
    _ _ _ _
    (_|| | |(_|>< The Data Charmer
    _|
    [url]http://datacharmer.blogspot.com/[/url]
    Giuseppe Maxia Guest

  5. #5

    Default Re: Slow queries when using myODBC with ASP pages

    Fred a écrit :
    > Hi,
    >
    > I have a website hosted on two servers bi-xeon(Win2003, 1GB RAM) : one
    > for the website, one for MySQL 4.
    >
    > I access MySQL from my ASP Pages with myOBDC.
    I made som other tests :

    - On the dataserver, with MyODBC, the query runs in 1.5 sec
    - On the web server (connected directly with an ip 192.168.0.1) : it
    takes between 3 and 18 sec
    - On an other server connected via a switch : 1.5 sec

    It seems that there is a communication problem between the database
    server and the webserver (the TCP/IP is working fine with file copying,
    for example), but i don't know what happens.

    MyODBC configuration is the same on the three servers.

    I tried the skip-name-resolve option, but the problem persists.





    Fred Guest

  6. #6

    Default Re: Slow queries when using myODBC with ASP pages

    Fred a écrit :
    > It seems that there is a communication problem between the database
    > server and the webserver (the TCP/IP is working fine with file copying,
    > for example), but i don't know what happens.

    I finally solved my problem : I changed my network adapter configuration
    from full-duplex to half-duplex.

    Fred
    Fred Guest

Similar Threads

  1. Replies: 0
    Last Post: January 25th, 11:20 PM
  2. slow queries from CF 5 to CF 7
    By dr_bozak in forum Coldfusion Database Access
    Replies: 19
    Last Post: November 23rd, 05:02 AM
  3. Slow Queries with Linux/Oracle
    By cetacea in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 31st, 02:29 PM
  4. CF 5 generating slow DB queries
    By AdamK in forum Coldfusion Database Access
    Replies: 0
    Last Post: March 15th, 04:48 PM
  5. OS X slow to print web pages?
    By Robin Burns in forum Mac Applications & Software
    Replies: 1
    Last Post: June 26th, 06:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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