Hi Kristian, In local server ,I also use -h <ip> option to login my mariadb not localhost . If this ip is on local server ,does the mariadb can transfer the ip to local soket ? If not ,I think the command " mysql -h db1 -utest -ptest -D IST < insert_file.sql" should not has gap ? - Jerry. 2016-03-10 22:46 GMT+08:00 Kristian Nielsen <knielsen@knielsen-hq.org>:
林澤宇 <jerry08291021@gmail.com> writes:
I use a file include 100000 insert command statements to test the insert performanc . On local server ,the Mariadb spent about 20 second to insert data;but on remote server ,the MariaDB spent about 30 second to insert data .
Why the MariaDB has about 10 second gap ? Maybe the network should to cause some latancy ,but the time should not have so long .
Why do you think 10 seconds is unexpected?
If you are sending 100000 individual queries from a single client thread, that is 100000 network roundtrips. Extra 10 seconds for that seems reasonable, in fact it sounds quite fast to me (0.1 ms network roundtrip).
If you want better performance on remote server, try sending many statements in one roundtrip using multi-statement protocol, or running many queries in parallel from the client to overlap the roundtrips.
- Kristian.