You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Through the cargo build -r mission package out of the package, after starting, why the memory is so high, after debugging, is the reason for mysql library, I have any problems with the use of mysql library?
The text was updated successfully, but these errors were encountered:
Hi. I have to point out that few things are seriously wrong with your code:
You are using synchronous mysql driver with asynchronous runtime (tokio) — you should ether switch to mysql_async or properly wrap blocking calls into spawn_blocking.
Pool created for no reason — you should either use bare Conn or use single Pool to manage DB connections.
Regarding the memory usage in your case — I've tried your code as is on Mac and have only 3,7 MB of reported memory usage.
Regarding memory usage in general — few things may add here:
Connection stream internal buffer may grow up to max_allowed_packet setting defined on the server side
If Pool is in use then you should note that every established connection in the pool will have it's own stream with its own internal buffer, so the total memory consumption may grow up to max_allowed_packet * number of active connections in the pool
The library also have a general purpose buffer pool that you can tweak or turn off — see the Buffer Pool section in the docs.
Through the
cargo build -r
mission package out of the package, after starting, why the memory is so high, after debugging, is the reason for mysql library, I have any problems with the use of mysql library?The text was updated successfully, but these errors were encountered: