[MDEV-23124] Eliminate the overhead of repeated my_access() on every new connection/or USE Created: 2020-07-08 Updated: 2020-07-14 Resolved: 2020-07-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | 10.6.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Description |
|
This comes from analyzing benchmark which does "connect/disconnect", mostly The output from VTune shows a lot of time spent in GetFileAttributes(), which is Windows'
Here is the callstack leading to it
Given that NtWaitForWorkViaWorkerFactory is not anything we can influence much (that's a threadpool management), this makes my_access() the top-1 hotspot However we do not need to instantly recheck if directory is still there. If it was there, and there was no "drop database", it remains in place. We can assume, that removing database directory manually outside of the server does not happen (or those who do punish themselves), we can cache the results of this operation, speeding up the connect, and every "USE db" |
| Comments |
| Comment by Vladislav Vaintroub [ 2020-07-14 ] |
|
Sergej Vojtovich reported my_access overhead of 2-3% on Linux in connect/disconnect test. Not as big as on Windows, but still quite measurable. |