views:

72

answers:

1

In most web (PHP) apps, there is mysql_connect and some DB actions which means that if 1000 users is connected, 1000 connections are opened? But with C++ app it is incredibly slow...what is the main difference? Thanks

+1  A: 

PHP will automatically close the DB connections when the script terminates (unless you use persistent connections or have closed the connection yourself before the script terminates of course). In your C++ app, this will depend on how you actually handle connections. But I can imagine you will want to keep your connections open for a longer stretch of time in the C++ app, and thus you could hit the maximum number of concurrent users sooner.

You could also tweak some of the MySQL settings if you have performance issues.

But how are you accessing MySQL from your C++ app? Not using ODBC are you?

wimvds