php - MySQL InnoDB Hangs after few thousand inserts -


i using mysql v5.6.24 on linux mint, trying insert 1 million rows in table. has username , email fields. configured mysql follows:

innodb_buffer_pool_size=2gb innodb_additional_mem_pool_size = 16m innodb_log_file_size = 256m innodb_log_buffer_size = 64m innodb_flush_log_at_trx_commit=2 

this on local machine (i5-4gb ram). everytime run script, inserts few hundred rows, hangs , eats cpu upto 100%.

also using node insert these rows.

var post={         name: namedata ,         email : emaildata     };  connection.query('insert users set ?', post, function(error,info){     if(error){          console.log(error.message);     }else{     //console.log('u '+totalusers);     console.log(info.insertid);      } }); 

please guide me how optimize this.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -