|
|
|
|
|
by dillydally
5735 days ago
|
|
Erm, that solution is a little extreme, unless there are a few steps missing. The first things I'd do:
1. Aggregate those inserts into a single SQL command. You never want to be issuing O(n) SQL queries per request. 2. Use InnoDB, not MyISAM, for the database engine. I assume it's MyISAM because he's talking about table locking. InnoDB has row-level locking, so you'll be able to INSERT and SELECT from a table concurrently. I had a Facebook app with 20MM MAUs, and it worked fine with two machines. A component of the app was voting in polls, and I was processing ~10k votes per second. Each "vote" is an insert into a votes table. Soo...not really sure how you go from "We're running too many INSERT queries and locking the tables!" to "Async queues and MongoDB!" |
|
And on the server level, Passenger isn't optimized for running a single site. I use Unicorn for my Rails app.