Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. App performance reduce with remote mysql server
Forum Update on Monday, May 27th 2025

App performance reduce with remote mysql server

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 4.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    robi
    wrote on last edited by
    #1

    Hey guys, need help asap!
    i am developing a school management project that is very large and its multi-user that is database is centric in a remote server.
    now main question arise after opening a database..........
    1.its take a lot of time for query or fetching data from server that is reduce my qt app performance . so what should i do?
    i just use for my connect to db is here is the code snippet...

    @db= QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName(my.host.name");
    db.setDatabaseName("TheDatabaseName");
    db.setUserName("SomeUser");
    db.setPassword("VerySecretPassword");
    @
    please help me..i am new in qt

    Edit: Removed real-looking login information and replaced it by something obviously phony; Andre

    robi

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      In a first step you should immediately edit out any logon credentials in your post. Now.

      If you suffer from performance problems it might be

      • the network connection which isn't performant enough,
      • the database server which isn't performant enough,
      • bad database design,
      • suboptimal client code (frequency of updates, structure of SQL statements, ...).

      Take a look at the Query Log and the Slow Query Log, obey "MySQL performance basics":http://forge.mysql.com/wiki/Top10SQLPerformanceTips or just provide some actually useful bits of information (database design, application design, queries - whatever) so we might help you further (altough you will be better off at some database-centric forum/mailing list).

      But there is one thing I can tell you for sure: Qt is (most probably) not the reason your application is not performing as expected.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fluca1978
        wrote on last edited by
        #3

        If you want to exclude your application being the cause of the performance drop (I don't think it actually is the cause) you can simulate each query your application is doing via a remote mysql terminal and get an idea if there is a poor query that is consuming bandwidth or cpu (or both) or disk.
        Usually, this is a database design problem.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          robi
          wrote on last edited by
          #4

          Hi guys,
          thanks for your response as a new in qt it would be according to your answer.
          My client is server based that means data will remain at the central server so that multiuser can access those data using my client.Now...
          If i use localhost server it's ok enogh but when i am accessing remote database database for fetching or query then client response much slower than before i used localserver. So what should i do increase the performance...

          robi

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            Well, then still all those four problems might hit you (most probably you are hit be all). Again - without any implementation details there is nothing we can do for you. In addition, this is not a Qt-related problem so you might be better of at some MySQL/DBMS-centric forum or mailing list.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              I agree with the posters above that you most likely have a db and/or a network problem, not so much a Qt problem. However, if you remotely access database, you will have to take into account that that is going to be slow sometimes no matter what you do. There are plenty of reasons beyond the control of your application that may cause this.

              So, you will need to try to make sure the GUI of your application is at least not affected by your poor database performance. If you can, you can isolate your database transactions in a separate thread, so it does not block your GUI thread. Please note however that a database connection can only live in a single thread, and that this does not work if you use a class like QSqlQueryModel.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                robi
                wrote on last edited by
                #7

                Thanks for your help i am just getting close to what i need ..specially thanks @Andre

                robi

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fluca1978
                  wrote on last edited by
                  #8

                  Well, your application sounds like any other database based application out there, so the problem is almost in the way you query your data and you manage it. A good starting point is to activate logging on the remote server to see which queries are issued from the application, you could find you are making queries you don't need. As already emphasized in this thread, without more details it is very difficult to know what is going bad, it could be from a simple select * where you need only a field to a non-optimized join to a network problem to a lock issue.....

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    robi
                    wrote on last edited by
                    #9

                    Thanks for your coincidence I agree with @andre i need to use thread because gui is locked when querying data or submitting data to remote server...can any one tell how work well thread with sql please .........

                    robi

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved