ruby on rails - Increasing the number of simultaneous request to mysql -


Recently we changed the app server of our rail web page with peanuts [REE and Rail 2.3.8] Gave. There are 6 machines pointing to the same microsoft server and a memcatch server in production setup. I was an example of the first 5 occasions of each machine. Now we have 45 passenger examples because every machine has RAM 2 GB, 2 core CPU. Once we deployed this passenger in production. The website became so slow and all the requests that started in the queue and we had to roll back in the end.

Now we suspect that the increased load should be in the MySQL server. Already there are only 30 mysql connections and now we have 275 connections. Our website of MySQL server is set up similar to the machine. All the configs defaul limit was exempt buffer_pull_is is only 8 MB, although we have 16 GB RAM and the number of concurrent threads is 8.

Will this increase the connection to mysql simultaneously, when MySQL will respond slowly to 30 connections only? If so, how can we do better MySQL with 275 simultaneous connections in place.

Update:

More information on mysql server:

RAM: 16 GB CPU: two processors each 4 cores

Tables inodb With only the default INODAB config values

Thanks

uses a passive MySQL connection on a heap and server A network buffer. It is approximately 200 KB memory and zero CPU.

In the database using only INODB, you should edit /etc/sysctl.conf so that vm.swappiness = You should be encouraged innodb_buffer_pool_size with approximately 80% system memory as a dedicated database server machine. Make sure the box is not swap, that is, the VSIZE should not exceed the system RAM.

innodb_thread_concurrency can be set to 0 (unlimited) or from 32 to 64, if you are a bit crazy, then assume MySQL 5.5. The range is low in 5.1, and is around 4-8 in MySQL 5.0. It is not recommended to use earlier versions of MySQL in the machine with 8 or 16 cores, with improvements in the compatibility of MySQL 5.5 with InodBi 1.1.

There is no point in the variable thread_continrency It is used to call pthread_setconcurrency () in Linux, which does nothing. It had a function in the old Solaris / Sonos.

Without further information, the cause of your performance problems can not be determined by any security, but the above general advice may be helpful. More general advice on my limited experience with Ruby can be found in that article, a summary of a consulting job that I once had for the early version of a popular Facebook app. According to

Update:

, you are running a 5.0.45 community log, which is too old and does not perform well under concurrent loads. is. Use the existing 5.5 build, it should perform better than your the way you have.

Also, fix innodb_buffer_pool_size you are not going here with only 8 M pools

When you are on it, then innodb_file_per_table should be turned on.

Do not switch to innodb_flush_log_at_trx_commit = 2 which means that this means, but it can temporarily help you based on your temporary needs. This is not a permanent solution to your problems in any way, though.

If you have any type of writing, you must also review innodb_log_file_size and innodb_log_buffer_size.

If this establishment is earning money, then you need professional help. I am not doing this as a profession, but I can recommend it to people if you wish, outside the stack overflow Please contact me.

Update:

According to your process list, you have a lot of questions about sending state data . MySQL is in a situation when a query is being executed, that is, the main internal loop / query performance is busy in the loop. Appearance Engine Unmute Status You have to show something

  ... -------------- ROW operations --- - ---------- 3 questions inside the InnoDB, in queue 0 questions ...   

If that number is larger than 4-8 (inside Inododi) then 5.0 .x will have trouble. 5.5.x will perform very well here.

Regarding my.cnf: View my previous comments on your InnoDB See also my comments on thread_contorrency (without innodb_ prefix):

  On Linux, this There is absolutely nothing at all. Thread_concorrancency = 8   

You are not forgetting all the in-app configuration at all. Suppose you are using the InBab table, you are not doing well, no matter what you do.

Comments