I have a Razer Blade 15 laptop, running NodeJs with the knex library to access a MySql db by allocated in a WSL 2 VM.
This is the second time a come with the same issue, and the first one the only solution I found (by my own) is reinstalling Windows 10 to the fabric state.
The issue I have is that when I execute migrations (creating and altering db structure, like tables, indexes, etc), they run very slow. They used to execute in less than 1 minute, and now they take like 20 minutes, and I didn't change anything. The strange thing here is that when I execute them, my disk goes to 100% but running hyper slow, like you can see in the next image:
Disk at 100%, but System (which seems to represent the db calls) running at 1MB/s, when it can go up to 100MB/s without problems. Check here
All the other common apps runs OK, so the disk isn't the problem. I tried reinstalling mysql, reinstalling WSL, restoring PC to a previous date, and still have the same issue. The only solution I found the last time, after 1 week of trying, was to fully reinstall the OS.
I'm not using the mounted disk. Everything is running on the WSL2 VM.
Please, let me know if there's any information you need to help me, I'll send.
UPDATE 21/10/20 I tried installing Ubuntu 20.04 in a new disk partition. To my surprise, I had the same problem than in Windows.
Techical data requested: Disk: Liteon ca5-8d512 NvMe SSD RAM: 16G Processor: Intel Core i7-10750H, 6 cores, 12 threads
[Innodb Metrics][https://pastebin.com/Sx5FqiLi]
[https://pastebin.com/7X1TRrEw][Global Variables]
On Ubuntu 20.04, my process doesn't finish and shows this error:
Error: Error while executing "/home/nicolas/SystemOne/Repositories/aspect/api/seeds/development/04_myanmar.js" seed: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
at Seeder._waterfallBatch (/home/nicolas/SystemOne/Repositories/aspect/api/node_modules/knex/lib/seed/Seeder.js:118:23)
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
at Client_MySQL.acquireConnection (/home/nicolas/SystemOne/Repositories/aspect/api/node_modules/knex/lib/client.js:349:26)
at runNextTicks (internal/process/task_queues.js:54:5)
at listOnTimeout (internal/timers.js:501:9)
at processTimers (internal/timers.js:475:7)
I also made a manual stress test, calling to INSERT several times, for inserting rows to a simple table, adding only values to 1 column. Each INSERT takes about 0.1 second to execute. Then, selecting all rows (like 730) takes 0.00036 seconds, so my conclusion here is that the big problem is the insertions or schema altering.

Thank you :)


