Mysql config for the.cnf make sofware not response

innodbmy.cnfMySQL

First time i am sorry about my English , but please help me on my.cnf . I read many post about config Mysql for best optimize but not thing to imporve. My server is Data center that contains two windows and linux . window has 5 core 5 GBram and linux has 18 CPU , 20GB ram . My window has two software that was developed by c# and i am using dll mysql.data . two software ,they will craw data from another website and insert into data to linux , sometime call "select , update , delete" . they work every time about 10s to craw and 10s to craw and send data to linux . On my linux with 358 user online same time , they click on link . another link and stay very long , they call always call to Database every time . My server has 60% select and 40% write . I dont know how to config my.cnf . But some time software in window insert data to table of database on linux very long about 30s and some time it show not respoding . I dont know why and i dont know what parameter make table innodb lock or make innodb can not be inserted by c# . Now i would like to know how can i change and what parameter(variable) to change to get best performance for select and insert into with larger data . Thank you very much . This is my my.cnf ( i am using mysql 5.6.31 – MySQL Community Server (GPL))

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip_name_resolve
skip_external_locking
default_storage_engine=InnoDB
max_connections=20000
join_buffer_size=2M
open_files_limit=65535
query_cache_type=ON
query_cache_size=1G
thread_concurrency=36
thread_cache_size=25
table_open_cache=10048
wait_timeout=300
read_buffer_size=1M
sort_buffer_size=1M
read_rnd_buffer_size=1M
max_connect_errors=1000
long_query_time=7
key_buffer_size=128M
max_allowed_packet=268435456
interactive_timeout=400
myisam_sort_buffer_size = 64M
tmp_table_size=64M
max_heap_table_size=64M
innodb_file_per_table
innodb_flush_method=O_DIRECT
innodb_log_file_size=512M
innodb_buffer_pool_size=10G
innodb_buffer_pool_instances=10
innodb_log_buffer_size=64M
innodb_thread_concurrency=0

Best Answer

max_connections=20000  -- too large; make it only 200
query_cache_size=1G    -- REALLY BAD! -- make it only 50M
table_open_cache=10048  -- too high; try 3000
long_query_time=7  -- Lower to 2, turn on slowlog, keep an eye on it
innodb_buffer_pool_size=10G  -- OK with 16GB of RAM; not ok with 5GB of RAM

On 100

It is not practical, nor efficient, to try perform 100 queries simultaneously. Because of that, there is no way to "configure" it into existence. It is better to do...

  • Combine all the information into a single AJAX call -- the back and forth for AJAX is non-trivial, possibly even more costly than the database queries themselves.
  • If all the INSERTs are into the same table, then use a single "batch" INSERT with 100 rows. This will run 10 times as fast as a 100 1-row INSERTs.

If it is not 100 similar inserts, please provide more details about the queries.