-1

I need to increment a counter each time a web page is rendered.

  • When I use mongodb to do that, I can do about 16000 writes per second on a 4 cores/8 threads CPU on a regular disk.

  • When I use Mysql InnoDB table, I can do only... 30 writes per second on regular disk or 200 writes on SSD !!

Because I have only one write per transaction (basically I have no other write to do after incrementing my counter for a same http request) Using autocommit to False and manually commit will not help.

The différence is that Mongodb flushes writes lazyly.

I tried to have Mysql buffering writes before flushing them to disk by setting these parameters into my.cf, but it did not helped :

innodb_buffer_pool_size = 1G
innodb_flush_method=O_DIRECT
innodb_log_file_size=100M
innodb_change_buffering=all
innodb_thread_concurrency=8

Is there a way to have faster mysql writes ?

RolandoMySQLDBA
  • 182,700
  • 33
  • 317
  • 520
Eric
  • 99
  • 2

1 Answers1

0

The MySQL vs. MongoDB argument is in many ways a relational vs. NoSQL argument. Each one excels in certain scenarios and is ill-suited for others. And because of their very different structures each one contains features not found in the other.

aldwinaldwin
  • 1,305
  • 9
  • 9