Why with PHP hundreds of DB connections do not matter ... but in a C ++ application they do?

Most web applications (PHP) have mysql_connect and some DB actions, which means that if 1000 users are connected, 1000 connections are opened? But with C ++, the application is incredibly slow ... what is the main difference? Thanks

+3
source share
1 answer

PHP automatically closes database connections when the script completes (unless you use persistent connections or close the connection yourself before the script completes). In your C ++ application, this will depend on how you actually handle the connections. But I can imagine that you want your connections to open for a longer time in a C ++ application, and you could more quickly dial the maximum number of concurrent users.

You can also configure some of the MySQL options if you have performance issues.

But how do you access MySQL from your C ++ application? Are you not using ODBC?

+1
source

Source: https://habr.com/ru/post/1753673/


All Articles