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. Multi threaded server with separate database connection for every users
Forum Updated to NodeBB v4.3 + New Features

Multi threaded server with separate database connection for every users

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 639 Views 2 Watching
  • 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
    red_spider
    wrote on last edited by
    #1

    0_1505808902739_Server.jpg

    Hello everyone,
    I have several questions.
    Here is such structure
    There is created own thread for each user, with its connection to database. The question is whether is there some limits of simultaneous connections with database in Qt?
    And also as backend located behind the proxy that's why during time when user connects, his IP is always 127.0.0.1. But the nginx is setuped with forwarding settings, the settings of forwarding were taken from manual
    the config file of proxy is below

            location / {
                proxy_pass http://127.0.0.1:1555;
                proxy_http_version 1.1;
                proxy_read_timeout 15m;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-NginX-Proxy true;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection $connection_upgrade;
            }
    
    kshegunovK 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Each database (driver) might have a limit on concurrent users or
      use a locking method that makes concurrent users less optimal.

      But other than that, it should work
      https://stackoverflow.com/questions/5365235/qt-sql-threaded-database-queries

      1 Reply Last reply
      1
      • R red_spider

        0_1505808902739_Server.jpg

        Hello everyone,
        I have several questions.
        Here is such structure
        There is created own thread for each user, with its connection to database. The question is whether is there some limits of simultaneous connections with database in Qt?
        And also as backend located behind the proxy that's why during time when user connects, his IP is always 127.0.0.1. But the nginx is setuped with forwarding settings, the settings of forwarding were taken from manual
        the config file of proxy is below

                location / {
                    proxy_pass http://127.0.0.1:1555;
                    proxy_http_version 1.1;
                    proxy_read_timeout 15m;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-NginX-Proxy true;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection $connection_upgrade;
                }
        
        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        Also to add to @mrjj, each driver may be reentrant, thread-safe, a combination of the two or neither. So special care may be needed when having concurrent access to databases.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        2

        • Login

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